Tag Archives: ASP.NET

Enabling Tracing Programmatically in ASP.NET

By | January 2, 2011

ASP.NET provides a internal details of page related information by enabling Tracing. To use tracing, we need to explicitly enable it from Page directives as shown in below Enable tracing from page directives is one of the easiest way to enable it. But, we can use Page.Trace object to enable or disabled the tracing programmatically. Trace object is… Read More »

Know when your application pools recycling in IIS 7.5 – Log an entry in Event Viewer while recycling

By | December 29, 2010

In IIS 7.5 you can enable the event logging when application pool recycles. When IIS will log, for that you can set certain number of  settings.  This logging is very important when you want to find out why and when your application pool recycling. From List of Application pools, Right Click on the required Application Pool > Advanced… Read More »

How to count number of active session for State Server Session Mode ?

By | December 28, 2010

While dealing with ASP.NET Session, generaly we use Session_Start() method in Global.aspx for count the number of active session, as whenever a new session start, it invoked the Session_Start method. Generally most of the developer use an Application variable with in Session_Start method to count the total number of active session as shown in below. But, sometime, when… Read More »

How to calculate Session data size for SQL Server session mode?

By | December 27, 2010

SQL Server use ASPState database to store the session information for SQL Server Session mode. ASPState database having two tables ASPStateTempApplications and ASPStateTempSessions. ASPStateTempApplications  table contains Application ID and Application Name which is specific to each and every application which are using SQL Server session mode on the particular database. ASPStateTempSessions table having numbers of fields to store… Read More »

How to set automatically focus on ASP.NET controls when validation fails ?

By | December 25, 2010

If you are using ASP.NET Validation Control then you can use “SetFocusOnError” properties to automatically focus the control if validation fails. This will help the end user to identify the control easily. To set focus automatically you have to set SetFocusOnError=”True”. By default it’s false. SetFocusOnError of a validation control is associated with “ControlToValidate” properties. If the validation… Read More »