Click here to Skip to main content
15,892,480 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi i am doing a login page and i have used validation controls for username textbox and password textbox.Along with this, i have created image button which direct to another page.but when i click on that image button, this validation control prevents me from going to that page.Can anyone tell me how to avoid that.Below is my html code:
 <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
     UserName/Email:<br />
<asp:TextBox ID="TextBox1" runat="server" MaxLength="60" class="water"   ></asp:TextBox><asp:RequiredFieldValidator
    ID="RequiredFieldValidator1" runat="server" ErrorMessage="*Username/Email Required" 
            ControlToValidate="TextBox1" ForeColor="Red"></asp:RequiredFieldValidator><br />
Password:<br />
<asp:TextBox ID="TextBox2" runat="server" MaxLength="60" class="water"  TextMode="Password" ></asp:TextBox><asp:RequiredFieldValidator
    ID="RequiredFieldValidator2" runat="server" ErrorMessage="*Password Required" 
            ControlToValidate="TextBox2" ForeColor="Red"></asp:RequiredFieldValidator><br />
            <asp:Button ID="Button7" runat="server" Text="Login" BackColor="#BD362F" 
          ForeColor="White" onclick="Button7_Click"></asp:Button><br />
                  <asp:ImageButton ID="ImageButton1" runat="server" 
            ImageUrl="~/images/new_user_signup.jpg" Width="150px" 
    onclick="ImageButton1_Click" />
    
    </ContentTemplate>
    </asp:UpdatePanel>
Posted
Comments
R-a-v-i-k-u-m-a-r 19-Feb-14 3:29am    
share your onclick event code for the button
Jignesh Khant 19-Feb-14 3:30am    
Set the 'causesvalidation' property of image button to 'false'.
faizel s 19-Feb-14 3:38am    
Thank you Sir,it worked god bless you

1 solution

Also try and apply validation group property.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900