I have a problem: when I call Response.Redirect () from MasterPage, it does not work. Well, debugging, I see that until the Pre_Render () target is loaded and then the previous page is displayed.
Here is the best code to explain:
(from MasterPageMain.master.cs)
protected void Page_Init(object sender, EventArgs e)
{
string m_QueryStringValue = Request.QueryString.Get("action");
if ((!string.IsNullOrEmpty(m_QueryStringValue)) && (m_QueryStringValue.ToLower() == "send"))
{
if (Session["to"] != null && Session["to"] is List<string>) this.SendPageByMail();
else
{
Session.Add("AddressToSend", Request.RawUrl);
Response.Redirect("~/chooseRecipients.aspx");
}
}
}
I have javascript that adds querystring by adding "action = send" when I click the submit button.
If I am on the page "~ / somethingInterestingToSend ()" - for example, I want to get to the recipient selection page, but when I click the "Send" button, I always see the same page.
What mistake?
p4bl0 source
share