c# - Prevent page reload when setting session variable -


i have asp button, , on click event session variable set , page redirected. problem process requires 2 clicks - once set session , redirect. how can set session , redirect in 1 click? code follows:

protected void btn_login_click(object sender, eventargs e) {        httpcontext.current.rewritepath("anotherpage.aspx");        session.add("user-id", _id); } 

protected void btn_login_click(object sender, eventargs e) {            session.add("user-id", _id);     response.redirect("anotherpage.aspx"); } 

Comments

Popular posts from this blog

javascript - How to synchronize the Three.js and HTML/SVG coordinate systems (especially w.r.t. the y-axis)? -

javascript - How do I find how many occurences are there of a highlighted string, and which occurence is it? -

java - Reading data from multiple zip files and combining them to one -