In Page 1 on button click I redirect the page to page 2 with msgid, and in page 2 in page load I check whether the previous page is valid. So i check (this.Page.PreviousPage != null)
but this is always null and the page gets redirected to page 1. I am doing this so that no one can change the msgid in the url. How can I solve this issues. thanks
页: 1
int msgid = Convert.ToInt32(Hidden_MsgID.Value);
string url = "Page2.aspx?MsgID=" + msgid;
Response.Redirect(url);
页: 1
if (this.Page.PreviousPage != null)
{
}
else
{
Response.Redirect("Page1.aspx");
}
instead of response.redirect I used server . transfer and it works Server.Transfer(string.Format("ResponseMetric.aspx?MsgID={0}", msgid));