I have a question about asp.net
When I used CustomValidator, I couldn't debug to the control.
Not working
☆View
<asp:TextBox ID="TextBox18" runat="server"Text="></asp:TextBox>
<br of >
<asp:CustomValidator ID="CustomValidator1" runat="server"
ErrorMessage="No asp.net" ControlToValidate="TextBox18" OnServerValidate="CustomValidator1_ServerValidate">/asp:CustomValidator><br/>
<asp:Button ID="Button5" runat="server" Text="Send"/>
☆Control
protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgsargs)
{
var text = args.Value;
if(text.IndexOf("asp.net")>=0)
{
args.IsValid=true;
}
else
{
args.IsValid=false;
}
}
Is there anything wrong with the above?Please teach me><
asp.net
There are no defects.
I tried debugging with the above source, but after pressing the send button
CustomValidator1_ServerValidate is invoked correctly.
© 2024 OneMinuteCode. All rights reserved.