Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Session state

Status
Not open for further replies.

kurie

Programmer
Jun 4, 2008
170
ZA
does anone know what might be causing this.
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules> section in the application configuration.

Stack trace:
" at System.Web.UI.Page.get_Session()\r\n at frmSite.Page_Load(Object sender, EventArgs e) in c:\\Projects\\Version9\\WebClientNew\\Web Cleint\\Home Page\\frmSite.aspx.cs:line 39\r\n at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)\r\n at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)\r\n at System.Web.UI.Control.OnLoad(EventArgs e)\r\n at System.Web.UI.Control.LoadRecursive()\r\n at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)"

The code was working fine and now it doesnt, i dont remember changing anything that might have caused this.
I added the EnablesessionState on the page directive but no change.
 
Hie guys
this is what is causing the problem with sessions:
protected void btnCancel_Click(object sender, EventArgs e)
{
string scriptString = "<script language=JavaScript> window.close(); </script>";

Page.ClientScript.RegisterClientScriptBlock(this.GetType(), "submitScript", scriptString);

}
Im trying to close a pop up window and it closes fine but from there on the sessions on the page will stop working.
Does any one how best to to close a pop up without affecting the sessions.
 
try just using client side, doesnt look like you need to postpack to process anything.

<asp:Button id="myButton" runat="server" text="Close Me" OnClientClick="window.close();" />

or just an anchor

<a href="#" onclick="window.close();">Close Me</a>

if it prompts/warns the user that its trying to close the page, you can try self.close();
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top