Hii.. I Am working on Client Tracking Application(asp.net 4.0 and c sharp),In Which we kept Function FnFillDropDown() In Global.asax file and called this function on Application_start event inside Global.asax. FnFillDropdown: this fn basically use to fill dropdown of country, city, common paramter , states names etc. As this function is kept in global.asax file,when we add new country or state we have to manually reset the iis using iisreset command. Our site is hosted on local network But we are going to host our site on web very soon . for that reason we need a quick solution to reset applicatoin state or tell us how do we call FnFillDrowpDown() Method from Code Behind My Code is
public class Global : System.Web.HttpApplication
{
private void FnFillDrowpDown()
{
Application.Clear();
BODropDown objBODropDown = new BODropDown();
DADropDown objDADropDown = new DADropDown();
DataTable dtList = new DataTable();
objBODropDown.EntityKey = DDLEntityKey.REG\_COUNTRY;
dtList = objDADropDown.GetValueList(objBODropDown);
this.Application.Add(DDLEntityKey.REG\_COUNTRY,dtList);
}
public void Application\_Start(object sender, EventArgs e)
{
FnFillDrowpDown();
}
}
I have also Tried to call this method using object of class Global but its throws Object Reference not Set.. Error as Application State coming out null.. Please suggest me any solution for this problem as i am new for asp.net Thanks...