Skip to main content

Posts

Showing posts from September, 2010

Access session variable in MVC razor

Access session variable in MVC razor @ if (Request.IsAuthenticated) {     @ if ( HttpContext .Current.Session[ "USERSESSION" ] != null )  {                @ Html.ActionLink( "Welcome " +  (( UserSession )( HttpContext .Current.Session[ "USERSESSION" ])).Name, "Index" , "Home"     )  } }

Select a default value in dropdownlist in MVC 5

Select a default value in dropdownlist  in MVC 5 @{     var TimeZone = new List < SelectListItem >();     foreach ( var item in ViewBag.TimeZoneOffset)     {         TimeZone.Add( new SelectListItem () { Text = item.TimeZone, Value = item. TimeZoneID, Selected = item.TimeZoneOffset== @Model.TimeZoneOffset ? true : false });     }     @ Html. DropDownList ( "TimeZoneID" , TimeZone, new { id = "TimeZoneID" ) }   

ASP.Net, C#, MVC and OOPs Concepts Tutorial and Sample Application!

Basic OOPs Concepts Delegates Events Generics Indexers Out keyword Ref keyword Property Struct Arrays Collection of Classes Class Library Virtual | Override | new Keyword Objects|Classes Abstraction Encapsulation Inheritance ASP.Net, C#, MVC Concepts Difference Between MVC 3, MVC 4, MVC 5 and MVC 6 Custom Roles Base Authorization in ASP.NET MVC Redirecting unauthorized controller in ASP NET MVC Windows Authentication in MVC 4 with IIS Express 13 New Key Features of MVC 6 - [vNext Architecture] The ASP.Net MVC Process Request Life Cycle? Import export excel file in MVC 5 How to get values from form collection in ASP.net MVC 4? Export Grid-view Data to Excel in ASP.Net ASP.NET MVC 4.0 Features Get base URL of an ASP.NET MVC Application Web grid in MVC 4 razor