Click here to Skip to main content
15,884,472 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I have take two session. In the popup I want to destroy the session but can not.
Session["StyleNo"] = ddlStyleNo.SelectedValue.ToString().Trim();
        Session["DefectNo"] = ddlDefectType.SelectedValue.ToString().Trim();
        ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "var Mleft = (screen.width/2)-(760/2);var Mtop = (screen.height/2)-(700/2);window.open( 'Reports/Smt_StyleWiseReportWindow.aspx?', null, 'height=700,width=760,status=yes,toolbar=no,scrollbars=yes,menubar=no,location=no,top=\'+Mtop+\', left=\'+Mleft+\'' );", true);

In popup codes I tried different three ways in finally block but none work.
finally
{
Session["StyleNo"] = null;
Session["StyleNo"] = "";
Session.Remove("StyleNo");
}
Posted
Updated 24-Sep-14 23:47pm
v2
Comments
[no name] 25-Sep-14 5:48am    
simple this will work with this line only
Session["StyleNo"] = null;

You can use session.clear();

for more details have look into this:
http://stackoverflow.com/questions/1470445/what-is-the-difference-between-session-abandon-and-session-clear[^]

It will give clear idea.. :)
 
Share this answer
 
After that code I clear the dropdown
SQL
Session["StyleNo"] = ddlStyleNo.SelectedValue.ToString().Trim();
        Session["DefectNo"] = ddlDefectType.SelectedValue.ToString().Trim();
        ScriptManager.RegisterStartupScript(this, typeof(string), "OPEN_WINDOW", "var Mleft = (screen.width/2)-(760/2);var Mtop = (screen.height/2)-(700/2);window.open( 'Reports/Smt_StyleWiseReportWindow.aspx?', null, 'height=700,width=760,status=yes,toolbar=no,scrollbars=yes,menubar=no,location=no,top=\'+Mtop+\', left=\'+Mleft+\'' );", true);



C#
ddlStyleNo.Items.Clear();
ddlDefectType.Items.Clear();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900