0

I'm working on web application :

you got a page for search at user and when you choose the user you want its open a new page with the id of the user

        Button btn = (Button)sender;
        Response.Write("<script>");
        Response.Write("var newWindow = window.open('UpdateUser.aspx?id="+Encryption.Encypt_URL(btn.CommandArgument)+"'); newWindow.resizeTo(screen.width, screen.height);");
        Response.Write("</script>"); 

in update user there is two state : take the id from the querystring if session not registered or take it from the session

if (Session["id"] == null)
            {id = Encryption.Decrypt(Request.QueryString["id"]);
             Session["id"] = Encryption.Encrypt(id+"");
            }
else
            {
                id = int.Parse(Encryption.Decrypt(Session["id"].ToString()));}

It's working fine ... but the problem is: when I want to choose another user... it choose the first one so I need to clear the session but don't know where to did it ?

tshepang
  • 12,111
  • 21
  • 91
  • 136

1 Answers1

0

I found the solution : every choose just clear the session

        Button btn = (Button)sender;
        Session["id"] = null;
        Response.Write("<script>");
        Response.Write("var newWindow = window.open('UpdateUser.aspx?id="+Encryption.Encypt_URL(btn.CommandArgument)+"'); newWindow.resizeTo(screen.width, screen.height);");
        Response.Write("</script>");