简化版,的ValidationSummary显示错误

编程入门 行业动态 更新时间:2024-10-24 22:17:31
本文介绍了简化版,的ValidationSummary显示错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我有我的GridView的一个问题,将不会显示在ValidationSummary-错误了。在ValidationSummary的HEADERTEXT并显示以及我设定出现在*每当防爆pressionValidation火灾。

I have a problem with my gridview which won't show the ValidationSummary-errors anymore. The Headertext of the ValidationSummary does show up as well as the * which I set to appear whenever the ExpressionValidation fires.

我敢肯定它之前的工作,但我不知道为什么它没有了。起初我以为它可能有一些做的,因为我有一个像5个不同的GridView不同TabPanels页面上的其他GridView的,但我已经制成每GridView控件1的ValidationGroup。

I'm quite sure it worked before, but I don't know why it doesn't anymore. At first I thought it might have something to do with the other GridViews on the page as I have like 5 different GridView in different TabPanels, but I already made one validationgroup per GridView.

标记:

<asp:UpdatePanel runat="server" UpdateMode="Always"> <ContentTemplate> <asp:GridView ID="gvBBG" runat="server" AutoGenerateColumns="false" DataKeyNames="ID" SkinID="gvWithoutWidth"> <Columns> <asp:TemplateField> <ItemTemplate> <asp:ImageButton runat="server" ImageUrl="~/Images/GridView/gv_edit.png" CommandName="Edit"/> </ItemTemplate> <EditItemTemplate> <asp:ImageButton runat="server" ImageUrl="~/Images/GridView/gv_cancel.png" CommandName="Cancel" CausesValidation="false"/> <asp:ImageButton Id="ibUpdate" runat="server" ImageUrl="~/Images/GridView/gv_update.png" CommandName="Update" CausesValidation="true" ValidationGroup="UpdateBBG" Enabled="true" OnClientClick="return confirm('Datensatz einspielen/aktualisieren?')"/> </EditItemTemplate> </asp:TemplateField> <asp:TemplateField HeaderText="KV West" HeaderStyle-HorizontalAlign="Left"> <EditItemTemplate> <asp:TextBox ID="tbKVWest" runat="server" Text='<%# Bind("KVWestFormatted") %>' ValidationGroup="UpdateBBG" Width="50px" Height="15px"></asp:TextBox> <asp:RequiredFieldValidator ID="rfvKVWest" ValidationGroup="UpdateBBG" runat="server" ControlToValidate="tbKVWest" ErrorMessage="Bitte KVWest als Summe angeben" SetFocusOnError="true">*</asp:RequiredFieldValidator> <asp:RegularExpressionValidator ID="revKVWest" ValidationGroup="UpdateBBG" runat="server" ValidationExpression="^[0-9]{1,9}((\,)[0-9]{1,2})?$" ControlToValidate="tbKVWest" SetFocusOnError="true">*</asp:RegularExpressionValidator> </EditItemTemplate> <ItemTemplate> <%# Eval("KVWestFormatted")%> </ItemTemplate> </asp:TemplateField> .... </Columns> <EmptyDataTemplate>Keine Daten vorhanden</EmptyDataTemplate> </asp:GridView> <p> <asp:ValidationSummary ID="vsUpdate3" runat="server" ShowMessageBox="true" ShowSummary="true" ValidationGroup="UpdateBBG" Font-Bold="true" ForeColor="Red" EnableClientScript="true" Enabled="true" HeaderText="Validierung..." /> </p>

将是很好,如果你们能帮助我在这里。我不是很确定是什么问题..也许这是在UpdatePanel?也许我做了一些愚蠢的错误..?我相当无能。

Would be nice if you guys could help me out here. Im not quite sure what the problem is .. maybe it's the UpdatePanel? Maybe I made some dumb mistake ..? I'm rather clueless.

推荐答案

发现问题。我必须设置为的RequiredFieldValidator和RegularEx pressionValidator的errormessage的。 ;)你不需要的文本框BTW内的的ValidationGroup

Found The problem .. I have to set the errormessage for both RequiredFieldValidator and RegularExpressionValidator. ;) You don't need the validationgroup inside of the textbox btw.

更多推荐

简化版,的ValidationSummary显示错误

本文发布于:2023-10-27 00:14:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1531758.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:错误   简化版   ValidationSummary

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!