[RESOLVED] Master page postback
Hi guys i have a question, i'm try to get the value of a textbox control that placed inside a master page, i used this code for retrieving back the texbox values:
Code:
If Not Page.PreviousPage Is Nothing Then
search = TryCast(Master.Page.PreviousPage.FindControl("SearchPost"), TextBox)
If Not search Is Nothing Then
Response.Write("My Text: " & search.Text)
End If
Else
search = TryCast(Master.FindControl("SearchPost"), TextBox)
End If
Now, if I try to get the textbox value where i'm in the target page (the page that contain that cod) there is no problem.
but if i'm posting it from Page A to Page B (target page) i can't get the master page textbox control value.
any suggestions ?
Re: [RESOLVED] Master page postback
It doesn't matter what the page is named, you simply need the class type. You'd get that from the codebehind, right at the top, at the class declaration.
But yes, you're getting yourself into an unnecessarily complicated situation; think about the purpose of this textbox, whether its value needs to be used throughout the app, and if it does, how you should be passing it around.