PostBackURL causes Object reference not set error with Master page

F

Fresh_Air_Rider

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.PreviousPage.FindControl("txtTest"), TextBox)

Response.Write(txtTest.Text)

I have tried adding "PreviousPageType" 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 "PostBackUrl" examples that use master
pages.

Thanks in anticipation
David
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,528
Members
45,000
Latest member
MurrayKeync

Latest Threads

Top