few question?

Discussion in 'ASP.NET' started by Swarnava, Oct 7, 2004.

  1. Swarnava

    Swarnava New Member

    Joined:
    Oct 1, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    hi All,
    Well I am an electronics and communication eng and working in a company as a trainee under software development, I have somewhat programmable knowledge on c and c++, Here I am learning ASP.NET with c# .
    Now as I am mot familiar to .NET or ASP i am facing a bit problem in vizualizing certain stuff, So any help will be highly appreciable,
    My question is:-
    Well I created a login page now i want to verify it with the database with those name and then if it exists wish to redirect to the welcome homepage, so what are the steps I should follow , Please information ono any field is highly appreciable.
    Maybe people who is familiar with vb.Net can tell me the basic algorithm they follow and i will try to implement that in asp.net.
    Thank you looking forward for your reply. Take care and happy programming :).

    sorry for posting in this section as by mistake instead of reading ALP I READ ASP , SORRY BUDDIES ;)
     
    Last edited: Oct 7, 2004
  2. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    Create a form with the following code
    Code:
     <form id="Form1" method="post" action="welcome.aspx">
       <input type="text" name="txt"> <input type="submit" value="send">
     </form>
    
    Now on welcome.aspx file page load event put this code
    Code:
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
      Dim str As String
      str = Request.Item("txt")
      ' SQL to test User
      'If Valid User
        Label1.text = "welcome"
      else
        Label1.text = "Not a Valid User"
    End Sub
    
    Now when you have the str from the previous page you can execute the sql you want with the database and check whether any user with that username exists and you can also have the password field in similar way and put an sql with your favorite database to verify the user then use different labels text to show match / mismatch.
     
  3. Swarnava

    Swarnava New Member

    Joined:
    Oct 1, 2004
    Messages:
    2
    Likes Received:
    0
    Trophy Points:
    0
    Thanks thatreally help, great!!!! work, only minor changes decleration of variable, great work, thank you sir,
     
  4. shabbir

    shabbir Administrator Staff Member

    Joined:
    Jul 12, 2004
    Messages:
    15,375
    Likes Received:
    388
    Trophy Points:
    83
    My pleasure
     

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice