Muhamad Taqi Muhamad Taqi - 14 days ago 28
ASP.NET (C#) Question Redirect To a Particular Page which name is in database column with user authentication?

I have a user table in which i have a column where i insert Dashboards where i want User to navigate after login. I am not good in I want help that how would i navigate to page with user which i have in my database column.

I have done this so far

protected void btn_login_Click(object sender, EventArgs e)
SqlConnection con = new SqlConnection("Data Source=MAAK-EDOOR;Initial Catalog=db_Security_Model;Integrated Security=True");
SqlCommand cmd = new SqlCommand();
cmd.Connection = con;
cmd.CommandType = System.Data.CommandType.StoredProcedure;
cmd.CommandText = "[dbo].[Validate_User]";
cmd.Parameters.AddWithValue("@Login", txt_username.Text);
cmd.Parameters.AddWithValue("@Password", txt_password.Text);
SqlDataReader sdr = cmd.ExecuteReader(System.Data.CommandBehavior.CloseConnection);
{//txt_username.Text == cmd.Parameters["@Login"].ToString()) && (txt_password.Text == cmd.Parameters["@Password"].ToString())
if ((cmd.Parameters["@Login"] != null) && (cmd.Parameters["@Password"]!= null))

// Response.Redirect();
lbl_invalid.Text = "Ivalid UserName or Password";
catch (Exception ex)



You can Navigate to the another page using the


For Passing the Database Column you can use the Session

Storing the Value in the Session in Login Page as follows

Session["DbcolumnValue"] ="YOur Value coming from DB";

In another Page you can access the session value as follows

if(Session["DbcolumnValue"]!= null)
string value = Session["DbcolumnValue"].ToString();