When i click on login button then pass username in my another page?
My Code Like This:
- Login Page:
- protected void Page_Load(object sender, EventArgs e)
- {
- {
- if (Request.QueryString["out"] != null)
- {
- Session.RemoveAll();
- Response.Redirect("Login.aspx");
- }
- }
- }
- protected void btnLogin_Click(object sender, EventArgs e)
- {
- DataTable dt = new DataTable();
- SqlDataAdapter da = new SqlDataAdapter("select Name from userLogin where Name='" + txtUserName.Text + "' AND Password='" + txtUserPassword.Text + "'", @"Data Source =.\SQLExpress;Initial Catalog = TourPortal; Integrated Security = True");
- da.Fill(dt);
- if (dt.Rows.Count == 0)
- {
- msg = "Please Enter Valid Username And Password";
- }
- else
- {
- Session.Add("UserName", dt.Rows[0][0].ToString());
- Response.Redirect("Dashboard.aspx");
- }
- another Page:
- "#" data-toggle="dropdown" aria-expanded="false">
- class="hidden-xs">----------Need Session Name---------------class="fa fa-angle-down pull-right">
-
"resources/img/icons/icon-user.png" class="user-image" alt="User Image">
-
- class
-
- class
="divider"> -
- "Default.aspx?out=1"
id="logout">class="ti-power-off"> Log Out
Rajeesh MenothPosted Mar 6, 2018, 2:21 AM
Dhimesh ParmarPosted Mar 6, 2018, 1:43 AM
Dhimesh ParmarPosted Mar 6, 2018, 1:21 AM
Ramesh PalanivelPosted Mar 6, 2018, 12:57 AM
Dhimesh ParmarPosted Mar 6, 2018, 12:46 AM
Dhimesh ParmarPosted Mar 6, 2018, 12:45 AM
Ramesh PalanivelPosted Mar 6, 2018, 12:40 AM