I am using Umbraco 4.7.1. and .ascx control in it where I have Updatepanel control. If I use it in Visual Studio Updatepanel works fine. When I move it to Umbraco it does full post back and Updatepanel does not work.
I am working in .NET 4.0. I have ScriptManager control in Master page.
Could somebody tell me why Updatepanel control does not work? Is there an issue with Umbraco and AJAX compatibility?
I don't get any errors. It works fine. .ascx control has GridView in it which is connected to SQL DB and inserting values. Everything works fine. It is just a postback which is triggered everytime I insert new values insted of smooth transition which should be working using Updatecontrol.
Hi. Perhaps for some reason the particular control that causes a postback in your case just isn't treated as an AsyncPostbackTrigger? There're several properties of an update panel that control this behaviour - e.g. the 'ChildAsTriggers' property and the 'Triggers' collection.
I will have similar pages with other .ascx controls and updatepanels. This one is the first where I use updatepanel, if that's what you mean in your question.
Berdia, am I right: a) you have a <form runat="server">, b) you have an update panel inside this form, c) you have an <umbraco:Macro> control inside this update panel that (the macro) is bound to an .ascx control that contains a control (e.g. a button) that causes a postback, right?
I've tried it and it worked in such a scenario. I still suspect that you have something wrong with your script manager or update panel settings. You need to make sure that your script manager has EnablePartialRendering="true" and your update panel has ChildrenAsTrigger="true" (they're all default values, but perhaps some is overwritten to another value).
Updatepanel not working in Umbraco.
Hi,
I am using Umbraco 4.7.1. and .ascx control in it where I have Updatepanel control. If I use it in Visual Studio Updatepanel works fine. When I move it to Umbraco it does full post back and Updatepanel does not work.
I am working in .NET 4.0. I have ScriptManager control in Master page.
Could somebody tell me why Updatepanel control does not work? Is there an issue with Umbraco and AJAX compatibility?
Thank you.
Hi Berdia
Do you get any errors when you insert the user control in Umbraco?
And how are you inserting it in Umbraco? Is it wrapped in a macro and placed directly on a template or is it inserted in a rich text editor?
Please ellaborate a bit more so that it will be easier to help you out :)
/Jan
Hi Jan,
I don't get any errors. It works fine. .ascx control has GridView in it which is connected to SQL DB and inserting values. Everything works fine. It is just a postback which is triggered everytime I insert new values insted of smooth transition which should be working using Updatecontrol.
User control is wrapped in Macro.
Thank you.
Berdia
Hi. Perhaps for some reason the particular control that causes a postback in your case just isn't treated as an AsyncPostbackTrigger? There're several properties of an update panel that control this behaviour - e.g. the 'ChildAsTriggers' property and the 'Triggers' collection.
Hi Berdia
Do you have multiple forms in your site? Or is your user control form contained within a serverside form, which encapsulates the whole page?
In other words...do you have <form runat="server">All content here...</form> in your template?
/Jan
Hi Jan,
I am using <form runat="server">all content</form> in my master page. As for page where I have .ascx control I have following:
<asp:Content ContentPlaceHolderID="cp_top" runat="server">
<umbraco:Macro Alias="Rooms" runat="server" />
</asp:Content>
Berdia
Hi Berdia
Try placing your macro outside the server side form on your template. Does it work then?
/Jan
I tried that. It gives me this error if I remove <form> tag from master page:
Control 'ContentPlaceHolderDefault_ScriptManager1' of type 'ScriptManager' must be placed inside a form tag with runat=server.
Hi Berdia
Ah yes, I guess that makes sense.
But do you have other forms on your website beside the one you're trying to insert now?
/Jan
Hi Jan,
I will have similar pages with other .ascx controls and updatepanels. This one is the first where I use updatepanel, if that's what you mean in your question.
Thank you.
Berdia, am I right: a) you have a <form runat="server">, b) you have an update panel inside this form, c) you have an <umbraco:Macro> control inside this update panel that (the macro) is bound to an .ascx control that contains a control (e.g. a button) that causes a postback, right?
Yes, that is right.
I've tried it and it worked in such a scenario. I still suspect that you have something wrong with your script manager or update panel settings. You need to make sure that your script manager has EnablePartialRendering="true" and your update panel has ChildrenAsTrigger="true" (they're all default values, but perhaps some is overwritten to another value).
is working on a reply...