PostBackURL causes Object reference not set error with Master page

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Fresh_Air_Rider@Hotmail.com

    PostBackURL causes Object reference not set error with Master page

    Hi

    I have two pages which both use the same master page.

    Page one contains an asp:textbox control and an asp:button control with
    it's PostBackUrl property set to the second page.

    The "code behind" of the receiving page contains the following page
    which results in "Object reference not set..."

    Dim txtTest As TextBox =
    CType(Page.Prev iousPage.FindCo ntrol("txtTest" ), TextBox)

    Response.Write( txtTest.Text)

    I have tried adding "PreviousPageTy pe" and "Reference" directive tags
    to the receiving page and all result in the same error message.

    This is extremely frustrating and if anyone could suggest what I might
    be doing wrong then I'd be very grateful.

    I haven't managed to find any "PostBackUr l" examples that use master
    pages.

    Thanks in anticipation
    David

Working...