A
Anton
hi
asp.net 3.5
On my form I got a textbox and a linkbutton. I've associated a
requiredfieldvalidator and a customvalidator to the textbox.
The problem is that when I click on the linkbutton the ServerValidate_test
code is executed (that is normal), BUT then it executes the rest of the code
behind the linkbutton. So it looks like the linkbutton doesn't care of the
result from the customvalidator.....
customvalidator markup:
<asp:CustomValidator ID="valCustom" runat="server"
ValidationGroup="vg" ControlToValidate="txt1"
EnableClientScript="false"
OnServerValidate="ServerValidate_test"
ErrorMessage="Error message">*
</asp:CustomValidator>
ServerValidate_test code:
protected void ServerValidate_test(object sender, ServerValidateEventArgs e)
{
e.IsValid = false;
}
Linkbutton:
<asp:LinkButton ID="lb" runat="server" CausesValidation="true"
ValidationGroup="vg" OnClick="lb_Click">Save</asp:LinkButton>
I haven't specified <Triggers> in the updatepanel...
any suggestions?
asp.net 3.5
On my form I got a textbox and a linkbutton. I've associated a
requiredfieldvalidator and a customvalidator to the textbox.
The problem is that when I click on the linkbutton the ServerValidate_test
code is executed (that is normal), BUT then it executes the rest of the code
behind the linkbutton. So it looks like the linkbutton doesn't care of the
result from the customvalidator.....
customvalidator markup:
<asp:CustomValidator ID="valCustom" runat="server"
ValidationGroup="vg" ControlToValidate="txt1"
EnableClientScript="false"
OnServerValidate="ServerValidate_test"
ErrorMessage="Error message">*
</asp:CustomValidator>
ServerValidate_test code:
protected void ServerValidate_test(object sender, ServerValidateEventArgs e)
{
e.IsValid = false;
}
Linkbutton:
<asp:LinkButton ID="lb" runat="server" CausesValidation="true"
ValidationGroup="vg" OnClick="lb_Click">Save</asp:LinkButton>
I haven't specified <Triggers> in the updatepanel...
any suggestions?