Link to home
Start Free TrialLog in
Avatar of Howard Katz
Howard KatzFlag for United States of America

asked on

Master Page and Update Panel problem

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
Master.QuoteNumber.
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 !!!
Avatar of CmdoProg2
CmdoProg2
Flag of United States of America image

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.
Avatar of Howard Katz

ASKER

So, what should I do differently?
Instead of running your select statement in the page load event, run it in the page loadcomplete event.
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.  
THanks
Howard
ASKER CERTIFIED SOLUTION
Avatar of CmdoProg2
CmdoProg2
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial