Initializing ASP.NET
-
I would like to call some methods at the very beginning of my web application. Also, I want to ensure that those methods are called only once per application lifetime, no matter what. What is the best way to accomplish this?
TRY THIS
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
FillConatcsGrid();//fills you contacts datagrid only once
CheckSessionId();//Will check the session id if need be only once
//Then you can go ahead with more fun in here...
}
}GoodLuck
-
I would like to call some methods at the very beginning of my web application. Also, I want to ensure that those methods are called only once per application lifetime, no matter what. What is the best way to accomplish this?
If your methods are Application specific, and wiil be same for all then users then you can call your methopds from the function Application_Start of Global.asax file. and if it user specific then you can call your methopds from the function Session_Start of Global.asax file.
Cheers!! Brij Check my latest Article :Exploring ASP.NET Validators
-
TRY THIS
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack)
{
FillConatcsGrid();//fills you contacts datagrid only once
CheckSessionId();//Will check the session id if need be only once
//Then you can go ahead with more fun in here...
}
}GoodLuck
-
I would like to call some methods at the very beginning of my web application. Also, I want to ensure that those methods are called only once per application lifetime, no matter what. What is the best way to accomplish this?
You can use methods of Global.asax file see help of Global.asax file in google
-
If your methods are Application specific, and wiil be same for all then users then you can call your methopds from the function Application_Start of Global.asax file. and if it user specific then you can call your methopds from the function Session_Start of Global.asax file.
Cheers!! Brij Check my latest Article :Exploring ASP.NET Validators
-
your welcome :)
Cheers!! Brij Check my latest Article :Exploring ASP.NET Validators
-
I would like to call some methods at the very beginning of my web application. Also, I want to ensure that those methods are called only once per application lifetime, no matter what. What is the best way to accomplish this?
The Global.asax file is the central point for ASP.NET applications. It provides numerous events to handle various application-wide tasks such as user authentication, application start up, and dealing with user sessions.The Global.asax file, which is derived from the HttpApplication class, maintains a pool of HttpApplication objects, and assigns them to applications as needed. The Global.asax file contains the following event: Application_Start : Fired when the first instance of the HttpApplication class is created. It allows you to create objects that are accessible by all HttpApplication instances. you can use this event it to perform the actions you wanted.