PreviousPage.IsCrossPagePostBack Only works Once RRS feed

  • Question

  • Hi,

    Not sure if this is the right place but here goes.

    I have created four pages test1.aspx, test2.aspx, test3.aspx and test4.aspx on each page is a textbox called textbox1 and a button.

    On test1.aspx if you click the button without entering anything in textbox1 you get redirected to an error page, this works.

    If on test1.aspx you enter ‘Member’ into textbox1 and click the button you go to test2.aspx and the text ‘Member’ now appears in the textbox1 on test2.aspx, this works.

    However if you now click the button on test2.aspx the contents from the text box do not transfer and you get an error, Why?

    Does anyone know how to fix this?

    I have the following code

        Protected Sub Page_Load(sender As Object, e As System.EventArgs) Handles Me.Load


            If PreviousPage IsNot Nothing AndAlso PreviousPage.IsCrossPagePostBack Then

                Dim SourceTextBox As TextBox

                SourceTextBox = CType(PreviousPage.FindControl("TextBox1"), TextBox)

                If SourceTextBox.Text = "Member" Then

                    TextBox1.Text = SourceTextBox.Text


                    Response.Redirect("~/error.aspx?Message=You need to login", True)

                End If


                Response.Redirect("~/error.aspx?Message=You need to login", True)

            End If


        End Sub



    Monday, December 7, 2015 11:49 AM

All replies

  • Hi Richard,

    Since your issue is about ASP.NET. I suggest you‘d better to post it to ASP.Net forum for better support:


    Thanks for your understanding.

    Best Regards,

    Lake Xiao

    • Proposed as answer by Just Karl Thursday, December 10, 2015 4:06 PM
    Wednesday, December 9, 2015 7:05 AM