Hello,
I have a button that is associated with a validation group. When I click
the button and a validation fails, I still want to code to execute. Can
this be done? Any help with this would be appreciate.
Thanks in advance, Sck10
In my code behind:
Sub Submit_Click(By Val Sender As Object, ByVal Args As EventArgs)
lblRegisterMsg. Text = "<hr />Page.IsValid :" & Page.IsValid.To String() &
"<br />"
End Sub
Snippet of content page:
<!-- Test Validation Stuff -->
<asp:Label id="lblRegister Msg" runat="server" />
<asp:Validation Summary
ValidationGroup ="vgDocUploa d"
id="valSummaryM essage"
HeaderText="<hr />The following errors were found:"
runat="server" />
<tr>
<td width="100"><di v align="right">S ubmitter:</div></td>
<td width="500"><di v align="left">
<asp:textbox id="txtSubmitte r" Runat="server"/>
<asp:RequiredFi eldValidator ID="rfvSubmitte r"
ValidationGroup ="vgDocUploa d"
ControlToValida te="txtSubmitte r"
ErrorMessage="Y our name is missing."
Text="*"
Runat="server" />
</div></td>
</tr>
<tr>
<td width="100"><di v align="right">S elect File:</div></td>
<td width="500"><di v align="left">
<asp:Button ID="btnUpload"
ValidationGroup ="vgDocUploa d"
Text="Upload"
OnClick="Submit _Click"
Runat="server"/>
</div></td>
</tr>