Go4Expert

Go4Expert (http://www.go4expert.com/)
-   ASP.NET (http://www.go4expert.com/forums/asp-net/)
-   -   few question? (http://www.go4expert.com/forums/few-question-t186/)

Swarnava 7Oct2004 13:09

few question?
 
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 ;)

shabbir 7Oct2004 13:47

Re: few question?
 
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.

Swarnava 7Oct2004 14:09

Re: few question?
 
Thanks thatreally help, great!!!! work, only minor changes decleration of variable, great work, thank you sir,

shabbir 7Oct2004 14:12

Re: few question?
 
Quote:

Thanks thatreally help, great!!!! work,
My pleasure


All times are GMT +5.5. The time now is 10:15.