ASP.Net UpdatePanel causes Dojo button to lose Dojo attributes
I have a page which contains an ASP UpdatePanel, and within the UpdatePanel, there is a button styled using Dojo with a dojoType of dijit.form.Button.
When the UpdatePanel updates, the button loses all of the CSS styling, so it reverts back to an ordinary looking html button.
I'm presuming this is because the dojo methods don't get called on a partial page postback, causing the button to get redrawn by the server and posted to the page, and dojo not being told about any of this.
Also, the "dojo/method" script is no longer associated with the button after the update.
This is the button:
<button id="btnShowMessages" dojoType="dijit.form.Button" type="button">
Show failure messages
<script type="dojo/method" event="onClick" args="evt">
dijit.byId("dlgFailedMessages").show();
</script>
</button>
This is wrapped in a standard ASP UpdatePanel with an ASP LinkButton causing the update (also located withi开发者_如何学Gon the UpdatePanel, so nothing is required in the <Triggers> tag).
Is there any way of making dojo aware of the partial page update? So that the button keeps it's style and dojo is still able to attach the method to the button.
Here is a solution:
http://www.codeproject.com/KB/ajax/Dojo-AjaxDotNet.aspx
精彩评论