更新面板和 JQuery 表单外观和感觉插件内的控件问题!!!帮助
我在更新面板控件下更新表单元素外观时遇到问题。
我使用 统一 JQuery 插件 来塑造表单控件(例如 DropDown)。它在 ASP.net 表单中工作得很好,但当用户选择 dropDownList 项目时,我使用更新面板来生成 CheckboxList 项目。
下图显示了表单的外观和感觉:
但是当我从列表中选择一个类别来更新 UpdatePanel 模板并更新复选框时,统一样式将从位于内部的控件中删除更新面板:
我在表单上方调用统一函数:
<script type="text/javascript">
$(function() {
$("input, textarea, select, button").uniform();
});
</script>
并更新面板标记:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<p>
انتخاب دسته: <myCtrl:CategoryDDL AutoPostback="True" EmptyItemText="همهی دستهها"
ID="CategoryDDL" OnSelectedIndexChanged="CategoryDDL_SelectedIndexChanged" runat="server"
SelectedCategoryId="0" />
</p>
<p>
برند محصولات<br />
<asp:CheckBoxList ID="CheckBoxListBrands" runat="server">
</asp:CheckBoxList>
</p>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="CategoryDDL" />
</Triggers>
</asp:UpdatePanel>
知道有人可以帮我纠正这个错误吗???有没有可能的方法来防止删除更新面板控件样式?
I have a problem with Updating Form Element Look and Feel under Update Panel Control.
I Used Uniform JQuery Plugin to shape form controls such as DropDown. it works very well in a ASP.net form but i used an update panel to generate CheckboxList Items when user selects a dropDownList Item.
The picture Below Shows form Look and Feel:
but when I Select a Category from list to update the UpdatePanel Template and updating CheckBoxes the uniform style removes from controls located inside update panel:
I call uniform function above the form:
<script type="text/javascript">
$(function() {
$("input, textarea, select, button").uniform();
});
</script>
and Update Panel Markup:
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<p>
انتخاب دسته: <myCtrl:CategoryDDL AutoPostback="True" EmptyItemText="همهی دستهها"
ID="CategoryDDL" OnSelectedIndexChanged="CategoryDDL_SelectedIndexChanged" runat="server"
SelectedCategoryId="0" />
</p>
<p>
برند محصولات<br />
<asp:CheckBoxList ID="CheckBoxListBrands" runat="server">
</asp:CheckBoxList>
</p>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="CategoryDDL" />
</Triggers>
</asp:UpdatePanel>
Know Can Anyone Help me to correct this bug??? is there any possible way to keeping update panel control style from removing?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您无法阻止它删除样式(元素被完全替换),但您可以通过在代码中运行一次来重新应用它:
它的作用是附加一个事件处理程序,以便在
endRequest
事件 UpdatePanel 触发(每次它会带着新的内容/元素回来)。如评论中所述,将 UpdatePanel 包装在包装器中将限制插件仅此区域。
You can't keep it from removing the styles (the elements are replaced completely), but you can re-apply it by running this once in your code:
What this does is attach an event handler to run the plugin again when the
endRequest
event of the UpdatePanel fires (each time it comes back with new content/elements).As noted in comments, wrapping the UpdatePanel in a wrapper will restrict the plugin to just this area.
就是
这样。
with
that is it..