Session Problem
-
hi function window.onunload() { if (window.event.clientX < 0 && window.event.clientY < 0) { //call Session.Abandon() } } in above funcion i am check browser closed button is press or not when button is press i want to close the session just like a Session.Abandon()(server side function). and second question is my project above 200 web form are there and every page redirect to another page so how can i used above code only single time
-
hi function window.onunload() { if (window.event.clientX < 0 && window.event.clientY < 0) { //call Session.Abandon() } } in above funcion i am check browser closed button is press or not when button is press i want to close the session just like a Session.Abandon()(server side function). and second question is my project above 200 web form are there and every page redirect to another page so how can i used above code only single time
You can do one thing
if(window.event.clientX < 0 && window.event.clientY <0)
{
window.open("CloseSession.aspx", "OpenWindow_Close_Session",'left=12000,top=1200,width=10,height=1');
}In CloseSession.aspx Page Load Do the server side task and make it self.Close();
protected void Page_Load(object sender, EventArgs e)
{
Session.Abandon();
//Close the popup window
string strPopupScript = "self.close();";
Page.ClientScript.RegisterStartupScript(typeof(Page), "PopUpScript", strPopupScript);
}Hope this will help you.
cheers, Abhijit CodeProject MVP
-
You can do one thing
if(window.event.clientX < 0 && window.event.clientY <0)
{
window.open("CloseSession.aspx", "OpenWindow_Close_Session",'left=12000,top=1200,width=10,height=1');
}In CloseSession.aspx Page Load Do the server side task and make it self.Close();
protected void Page_Load(object sender, EventArgs e)
{
Session.Abandon();
//Close the popup window
string strPopupScript = "self.close();";
Page.ClientScript.RegisterStartupScript(typeof(Page), "PopUpScript", strPopupScript);
}Hope this will help you.
cheers, Abhijit CodeProject MVP
but sir i cannot put this code my above 200 web page :((
-
but sir i cannot put this code my above 200 web page :((
So you don't have master page ?
cheers, Abhijit CodeProject MVP
-
but sir i cannot put this code my above 200 web page :((
you don't have to. Another alternative is create web handler page (ashx page) put the functionality Abhijit provided in the
ProcessRequest
call it using ajax.Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
-
you don't have to. Another alternative is create web handler page (ashx page) put the functionality Abhijit provided in the
ProcessRequest
call it using ajax.Yusuf Oh didn't you notice, analogous to square roots, they recently introduced rectangular, circular, and diamond roots to determine the size of the corresponding shapes when given the area. Luc Pattyn[^]
Yup Excelent... That is the best option, if you don't have the master page you can simply do it using handler other wise write the same in master page. :)
cheers, Abhijit CodeProject MVP