Results 1 to 2 of 2

Thread: using redirect

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 2001
    Posts
    116

    Question 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?

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jul 2001
    Posts
    116

    Thumbs up got it

    I set the CausesValidation="False" within the imagebutton

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width