Hi, I am using Chris Hammonds Excellent C# module development template but I have a strange issue which I am not sure if it is by design or not. I can build a module and register it as an extesnsion but my page load event and sessions are not persistant. It appears that the module is created from scratch everytime the page is loaded so none of the sessions or the view state of the controls will hold. Is this by design or am I missing something. Is there a work around?
Here s my pagelaod event in the module but the session is always null
private void Page_Load(object sender, System.EventArgs e)
{
try
{
if (Session["MedSearch"] == null)
{
Session[
"MedSearch"] = "A";
}
else
{
SearchSqlDataSource.SelectParameters[
"MedSearch"].DefaultValue = Session["MedSearch"].ToString();
Label1.Text = Session[
"MedSearch"].ToString();
}
ResultGridView.DataBind();
}
catch (Exception exc) //Module failed to load
{
Exceptions.ProcessModuleLoadException(this, exc);
}
}