-
using redirect
I have created a simple webform with some ImageButtons, Textboxes, labels and a submit button. I have a procedure so that when an imagebutton is clicked, it simply redirects to another page - For Example:
Code:
Sub GotoIndex(sender As Object, e As ImageClickEventArgs)
Response.Redirect("index.aspx")
End Sub
<asp:ImageButton id="home" onclick="GotoIndex" runat="server" src="Images/gifs/btnhome.gif" url="index.aspx" img="img" width="112px" height="22px"></asp:ImageButton>
This works ok so far....
I have added some validation checks for the textboxes using the RequiredFieldValidator control and now my ImageButton wont redirect me to my index.aspx page.
Code:
<asp:RequiredFieldValidator id="rfvFirstName"
runat="server" controltovalidate="txtFName" ErrorMessage="*"></asp:RequiredFieldValidator>
When I click the ImageButton with an empty textbox, it does nothing except trigger the ErrorMessage (*).
Anyone?
-
got it
I set the CausesValidation="False" within the imagebutton