I’m working in ASP.NET c# application.
I came to a part where I need to retain some value after response.redirect to the same page without using additional QueryString or Session, because Session more or less may burden the server’s performance even just a small value.
Below is my code fragment:
protected void ddl_SelectedIndexChanged(object sender, EventArgs e)
{
string id = ddl.SelectedValue;
string id2 = ddl2.SelectedValue;
Response.Redirect("http://sharepoint2007/sites/home/Lists/CustomList/DispForm.aspx?ID=" + id);
}
I wanted to retain the value id2 after the Response.Redirect, I’ve tried ViewState but seem like after the redirect, it treat the page as new page and ViewState value gone.
Update:
My intention to retain the value after redirect is wanted to bind back the dropdownlist selected value.
Please help.
Thank you in advanced.
using cookies will do the trick: