1
在下面的代碼...問題有兩個的UpdatePanel和校驗
<asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server" OnTextChanged="TextBox1_TextChanged"></asp:TextBox>
<cc1:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="TextBox1"
Display="Dynamic" ErrorMessage="This field is required">
*</cc1:RequiredFieldValidator>
<br />
<br />
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:Label ID="Label2" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
<asp:UpdatePanel runat="server" ID="UpdatePanel2" UpdateMode="Conditional">
<ContentTemplate>
<asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Button" />
<asp:Label ID="Label3" runat="server" Text="Label"></asp:Label>
</ContentTemplate>
</asp:UpdatePanel>
爲什麼的UpdatePanel2
內容是由存在於UpdatePanel1
的RequiredFieldValidator
影響!
它們被拆分,UpdateMode
設置爲Conditional
!!!
任何幫助!