TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
jayani chathurika
NA
14
8k
Login code
Mar 26 2013 11:52 PM
Protected Sub btnlogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnlogin.Click
Dim command1 As New SqlCommand
Dim sqlread1 As SqlDataReader
Try
Connect1.Openconnection()
command1.Connection = Connect1.consql1
command1.CommandText = "select User_name,password from Login where User_name='" + txtUsername.Text + "' and password='" + txtPass.Text + "'"
sqlread1 = command1.ExecuteReader
If Not sqlread1.HasRows Then
lblMessage.Visible = True
lblMessage.Text = "Invalid UserName or Password"
Exit Sub
Else
lblMessage.Text = ""
If ddldesignation.SelectedItem.
Text = "Additional Secretary" Then
Response.Redirect("~/Internal Audit.aspx")
ElseIf ddldesignation.SelectedItem.
Text = "Director" Then
Response.Redirect("~/Leave Details.aspx")
ElseIf ddldesignation.SelectedItem.
Text = "Acting Director" Then
Response.Redirect("~/Personal Information view.aspx")
ElseIf ddldesignation.SelectedItem.
Text = "User" Then
Response.Redirect("~/
PublicCommunication view.aspx")
End If
Do While sqlread1.Read()
'SAVE THE USERNAME TO COOKIES
Dim usercookie As HttpCookie = New HttpCookie("User_name")
usercookie.Values.Add("User_
name", sqlread1("User_name"))
usercookie.Expires = #12/31/2013#
'place it on the footer
lblMessage.Visible = True
lblMessage.Text = sqlread1("User_name")
Session("User_name") = txtUsername.Text
'redirect to topic page
Response.Redirect("Menu.aspx?
User_name=" & sqlread1("User_name"))
Loop
End If
Catch ex As Exception
Finally
Connect1.closeconnection()
End Try
Connect1.closeconnection()
End Sub
In this code out put is always
Response.Redirect("Menu.aspx?
User_name=" & sqlread1("User_name"))................
But i want to
ddldesignation.SelectedItem.
Text = "Additional Secretary" Then
Response.Redirect("~/Internal Audit.aspx")
according to designation..please help to execute this code
Reply
Answers (
4
)
Error when passing connectin string to activeX
google custom search add website name in asp.net page