1
Answer

Object Initialization in ASP.Net webForm

Sanjay Sharma

Sanjay Sharma

6y
543
1
Hi Team,
 
I am working on ASP.Net WebForm ( in Era of MVC sad ).
 
I have following button events which perfrom independent actions 
 
XX.ProductBLL.GeneralInfo generalInfoBLL = new XX.ProductBLL.GeneralInfo generalInfoBLL();
 
protected void btnSaveCharge_Click(object sender, EventArgs e)
{
  generalInfoBLL.CallmethodA();
  .......
   ....... 
 
protected void btnAddCharge_Click(object sender, EventArgs e)
{
  
generalInfoBLL.CallmethodB();
.......
.......
 
.......
.......
 
}
 
Question is this fesible way  to avoid initaization in each event? will not anytime 
 generalInfoBLL to null in anyof the event.
 
Answers (1)