Validate form

Discussion in 'ASP .Net' started by =?Utf-8?B?UmFqYW5p?=, Nov 13, 2004.

  1. Hello,

    I am learning asp.net and i have experience in asp. I am using VS.NET for
    developing dotNET pages.
    Its login form. I placed two asp:textbox s for userid and password. and one
    button(html server control) and one asp:label

    How to vallidate whether the user has entered userid and password or not. If
    not display an error message in the label. And also placed a button(html
    server control) to redirect to my home page.
    I wrote the code response.redirect("default.htm")
    But its not redirecting. In the submit button also i wrote the code

    private sub button2_serverClick(ByVal sender as System.object,ByVal e as
    System.EventArgs)
    if txtUID.value="" then
    errlbl.text="Enter User ID"
    end if
    end sub

    Can u explain me how to do this. I tried with requiredfieldvalidator control
    also. If i click home button also its checking for errors and not performing
    actual action(redirect to home page).


    Thanx in advance
     
    =?Utf-8?B?UmFqYW5p?=, Nov 13, 2004
    #1
    1. Advertising

  2. Make sure u have CausesValidation="False" in ur button
    Btw go to :- http://samples.gotdotnet.com/quickstart/aspplus/
    And read through :- Server Control Form Validation
    Hope this helps!!




    "Rajani" <> wrote in message
    news:...
    > Hello,
    >
    > I am learning asp.net and i have experience in asp. I am using VS.NET

    for
    > developing dotNET pages.
    > Its login form. I placed two asp:textbox s for userid and password. and

    one
    > button(html server control) and one asp:label
    >
    > How to vallidate whether the user has entered userid and password or not.

    If
    > not display an error message in the label. And also placed a button(html
    > server control) to redirect to my home page.
    > I wrote the code response.redirect("default.htm")
    > But its not redirecting. In the submit button also i wrote the code
    >
    > private sub button2_serverClick(ByVal sender as System.object,ByVal e as
    > System.EventArgs)
    > if txtUID.value="" then
    > errlbl.text="Enter User ID"
    > end if
    > end sub
    >
    > Can u explain me how to do this. I tried with requiredfieldvalidator

    control
    > also. If i click home button also its checking for errors and not

    performing
    > actual action(redirect to home page).
    >
    >
    > Thanx in advance
     
    Patrick.O.Ige, Nov 13, 2004
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jack Wheeler

    form wont validate on remote server

    Jack Wheeler, Jun 14, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    324
    George
    Jun 14, 2004
  2. Wysiwyg
    Replies:
    4
    Views:
    820
    IPGrunt
    Jan 26, 2005
  3. =?Utf-8?B?QWRyaWFu?=

    Asp.net wont validate form

    =?Utf-8?B?QWRyaWFu?=, May 13, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    505
    =?Utf-8?B?QWRyaWFu?=
    May 13, 2005
  4. Claire
    Replies:
    2
    Views:
    3,523
    Roedy Green
    May 6, 2004
  5. Replies:
    1
    Views:
    754
    Randell D.
    Mar 17, 2005
Loading...

Share This Page