i have done it like this .. i took two master age one only for login and another have al pages . then i treid this code it work fine
protected void Page_Load(object sender, EventArgs e)
{
con.Open();
Label1.Text = Session["name"].ToString();
string s = "SELECT name,password FROM admin" + " WHERE name='" + Label1.Text + "'";
SqlCommand cmd = new SqlCommand(s, con);
SqlDataReader Dr = cmd.ExecuteReader();
if (Dr.Read())
{
Menu4.Visible = true;
con.Close();
}
else
{
con.Close();
con.Open();
String q = "SELECT Name,Password FROM user2 " + " WHERE Name='" + Label1.Text + "'";
SqlCommand cmnd = new SqlCommand(q, con);
SqlDataReader Dr1 = cmnd.ExecuteReader();
if (Dr1.Read())
{
Menu1.Visible = true;
con.Close();
}
else
{
Menu4.Visible = true;
}
}
}