ASP.Net UpdatePanel 导致 Dojo 按钮丢失 Dojo 属性
我有一个包含 ASP UpdatePanel 的页面,在 UpdatePanel 中,有一个使用 Dojo 设计样式的按钮,其 dojoType 为 dijit.form.Button。
当 UpdatePanel 更新时,按钮会丢失所有 CSS 样式,因此它会恢复为普通的 html 按钮。
我推测这是因为 dojo 方法不会在部分页面回发时被调用,导致按钮被服务器重绘并发布到页面,并且 dojo 没有被告知任何这些情况。
此外,更新后“dojo/method”脚本不再与按钮关联。
这是按钮:
<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>
它包含在标准 ASP UpdatePanel 中,并带有导致更新的 ASP LinkButton(也位于 UpdatePanel 内,因此
有没有办法让dojo知道部分页面更新?这样按钮就可以保持其样式,并且 dojo 仍然能够将方法附加到按钮。
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 within 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.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
这是一个解决方案:
http://www.codeproject.com/KB/ajax /Dojo-AjaxDotNet.aspx
Here is a solution:
http://www.codeproject.com/KB/ajax/Dojo-AjaxDotNet.aspx