Postback error, page not displayed when redirected after postback

与世无争的帅哥 提交于 2019-12-12 01:49:17

问题


I have link to the Page3 from Page1 and Page2.

In Page1 I have a gridview and when A row is selected it redirects to the Page3 and it passes a msgID to page3 in the URL. And in Page3 URL if someone tries to change the URL it redirects to Page1.

In Page2 I have a modal Pop up which is displayed in page2 after postback, the popup has a button to view Page3 and it passes the msgID to page3 in the URL.

    Response.Redirect(string.Format("Page3.aspx?MsgID={0}", msgid));

When the Page3 is redirected from page1 everything is fine. When I redirect to page3 from page2 it gets redirected to page1. I am not able to view the page3 from page2. What mistake I am doing. thanks

Page load in Page3:

if (!IsPostBack)
        {
            if (this.Page.PreviousPage != null)  
            {

            }
            else
            {
                Response.Redirect("page1.aspx");
            }
         }

来源:https://stackoverflow.com/questions/7740517/postback-error-page-not-displayed-when-redirected-after-postback

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!