Hello I have a problem I am using ajax and I have a aspx page that belongs to a master page. I am using the update panel on the aspx page and want to acheive the following When the user clicks a ButtonLink in the aspx page I want it to trigger the button OnClick on the master page. I have tried the following;
/*This is in the aspx page*/ ... ...
<atlas:UpdatePanel ID="UpdatePanel" runat="server"><ContentTemplate>
...
...
</ContentTemplate>
<Triggers>
<atlas:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
</Triggers>
</atlas:UpdatePanel>
Button1 is in the master page! But nothing happends.. Have I missed out on something?
Yes, what you're doing with the above code is telling the update panel to update when Button1 is clicked.
First, you need to set the update panel's UpdateMode to Conditional.
Next, make sure the ScriptManager's EnablePartialRendering is set to True.
You may need to set your trigger programmatically and use FindControl.
So if I have one button in my master page and one linkbutton in my aspx page could I
add a update panel to the button in the masterpage. set this update panels trigger to the link button in the aspx page?
would this work? im thinking how can I get the id of the linkburtton in the aspx page?
tnx
you want to go the other way; set the trigger of the update panel in the master page from the content page. An example is here: http://msdn2.microsoft.com/en-us/library/xxwa0ff0.aspx
What error you are facing...
whether you places SCriptManager on Master Page or not ?
http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx
Hi Guys my problem is very simple i have a masterpage with all my menus and headers and footers. Now what i want is when i click on the menus or buttons on the left i want to update only contentplaceholder with new page and controls of that page. is it possible!!! if yes plz tell me how.
Faisal
chetan.sarode:
What error you are facing...
whether you places SCriptManager on Master Page or not ?
http://ajax.asp.net/docs/mref/T_System_Web_UI_UpdatePanel.aspx
Yes.
You can build your content pages as user controls...
Then your menu items can fire a function that loads the controls into your place holder... That way only the place holder is being updated...
But you won't need to do that in a "master page"... that sort of defeats the purpose. Just create your header/menu/footers in default.aspx, otherwise, you will just need a blank default.aspx page loading at the begining.
Master pages don't load on their own.
Thanks i will do that and let you inform what i have got.
Faisal
No comments:
Post a Comment