1 2 3 4 5 6 7 8 9 10 |
Controller.cs // Index.aspx << View has ViewResult public ViewResult Index() { String asd= Request.Params.Get(0); int hour = DateTime.Now.Hour; ViewData["kutay_variable"] = (hour < 12 ? "morning" : "afternoon"); return View(); } |
Inside of View page,
1 2 3 |
<%=ViewData["kutay_variable"]%> >>> Out put is morning or afternoorn |