Tag Archives: ASP.NET

When we can use HttpContext.Current.Items to stores data in ASP.NET ?

By | April 25, 2011

To answer this question In a single statement, you can use HttpContext.Current.Items for very short term storage. By Short term storage means, this data is valid for a single HTTP Request.  There are many confusion around regarding storing data in HttpContext.Current. Items and storing data in Session variable. In this post I am going to describe what are… Read More »

Selecting Cache Provider On the Fly in ASP.NET

By | March 19, 2011

If you have multiple Cache Provider in your ASP.NET application you can  set the output cache provider dynamically at runtime .  This is extremely useful if want to store cache data in different storage based on the usages of the data. To use this features you need to override the GetOutputCacheProviderName() method within the Global.asax file of your… Read More »

Creating Custom HTML Helpers in ASP.NET MVC

By | March 14, 2011

ASP.NET MVC provides many built-in HTML Helpers.  With help of HTML Helpers we can reduce the amount of typing of HTML tags for creating a HTML page. For example we use Html.TextBox() helper method it generates html input textbox. Write the following code snippet in MVC View: <%=Html.TextBox(“txtName”,20)%> It generates the following html in output page: <input id=”txtName” name=”txtName”… Read More »

Run ASP.NET Web Application from Command Prompt

By | February 28, 2011

Visual Studio has its own integrated ASP.NET Runtime engine, which helps to run any ASP.NET web application with in Visual Studio.  While running application from Visual Studio, you must have seen a popup notification in System Tray (As shown in below image) , which is notification of ASP.NET Development Server. This ASP.NET Development Server is nothing but a… Read More »

How EnableViewStateMAC Makes ViewState Secure ?

By | February 24, 2011

The ASP.NET ViewState is a client side state management mechanism. The ViewState is stored in a hidden field with an ID __VIEWSTATE. Typically, stored ViewState information looks like: ViewState value looks likes an encrypted string. This is nothing but a Base64 encoded string, and is not an encrypted string. So it can be easily decoded. The main reasons… Read More »