Master Page and Update Panel problem

Posted on 2007-10-03
Medium Priority
Last Modified: 2013-11-07
Good morning Experts,
I have a Master page with a script mgr on it and a Content page with an Update Panel.
On the Master page i have a textbox (ID = txtSearchByNumber)  
and a imagebutton (ID= ibtnSearchByQuote) .
I expose the textbox.text property on the master page as QuoteNumber.  
I registered the imagebutton click event like this: ScriptManager1.RegisterAsyncPostBackControl(ibtnSearchByQuote)
I have this tag on the Content page: <%@ mastertype virtualpath="~/Quote.master" %>
In the Page Load of the Content page, I am able to get the value of the textbox from the Master Page by
I run a Select statement using the Master.QuoteNumber value in my where clause.  All seems well.  All the textboxes are set with the proper values when I step throug the code behind of the Content page.  
Problem is that the Master Page seems to load again and the  changes are wiped out
HELP !!!
Question by:Howard Katz
  • 3
  • 2
LVL 12

Expert Comment

ID: 20007068
The Master Page Load always occurs after the content Page Load event.  The Page_LoadComplete event of the content page occurs after master page load.

Author Comment

by:Howard Katz
ID: 20007149
So, what should I do differently?
LVL 12

Expert Comment

ID: 20008570
Instead of running your select statement in the page load event, run it in the page loadcomplete event.

Author Comment

by:Howard Katz
ID: 20009977
In the Master or Content page? I have gotten it to work but I ran it in the Page_load event of the Master page.  It was quite cumbersome because I had to create instances of each control type and then do a FindControl. Here is ex:
                Dim DOA As TextBox = MainContent.FindControl("CL1_f_48")
                DOA.Text = MyReader("f_48")

Could you be a bit more explicit.  
LVL 12

Accepted Solution

CmdoProg2 earned 2000 total points
ID: 20010051
In the Content page,

  Protected Sub Page_LoadComplete(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.LoadComplete
         DOA.Text = MyReader(Master.QuoteNumber)
  End Sub

Featured Post

Vote for the Most Valuable Expert

It’s time to recognize experts that go above and beyond with helpful solutions and engagement on site. Choose from the top experts in the Hall of Fame or on the right rail of your favorite topic page. Look for the blue “Nominate” button on their profile to vote.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Screencast - Getting to Know the Pipeline
Is your OST file inaccessible, Need to transfer OST file from one computer to another? Want to convert OST file to PST? If the answer to any of the above question is yes, then look no further. With the help of Stellar OST to PST Converter, you can e…
Suggested Courses
Course of the Month15 days, 8 hours left to enroll

850 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question