Tuesday, May 26, 2009

How to deal with disabled Javascript in Browsers in ASP.NET MVC

Add noscript html tag into master page to redirect description page:
<noscript>
<meta http-equiv="refresh" content="5; url=<%= Url.Relative("~/ControllerName/ActionName") %>" />
</noscript>

Monday, May 25, 2009

Cache in MVC ActionFilterAttribute

Source

How to add HTML Attributes into html helper

<%=Html.DropDownList("CategoryID", new {@class="input", style="display:none"})%>

Friday, May 22, 2009

Simplest way to redirect user to maintaining page

Just add an HTML file named “app_offline.htm” to the root directory of your website. Adding this file will clear the server cache. When ASP.NET sees the app_offline.htm file, it will shut-down the app-domain for the application (and not restart it for requests), and instead send back the contents of the app_offline.htm file in response to all new dynamic requests for the application.

The size of the file should be more that 512 bytes to be displayed.