User639567535 posted
I have form.aspx in that there is dropdown
<asp:Label ID="Label3" runat="server" Text="Select values"></asp:Label>
<asp:DropDownList ID="regiondrop" runat="server" AutoPostBack="True"
onselectedindexchanged="regiondrop_SelectedIndexChanged">
</asp:DropDownList>
<asp:RequiredFieldValidator controltovalidate="regiondrop" ID="RequiredFieldValidator1" runat="server" ErrorMessage="Select Region">
</asp:RequiredFieldValidator>
There is mutlilpe values in that drodown ..
e.g.
Car
Truck
Bike
Drink
Factory
There is another login page Login.aspx .
Login code
protected void Button1_Click(object sender, EventArgs e)
{
try
{
//Label1.BackColor = "F8D8D7";
loginmethod(txt_us.Text, txt_pwd.Text);
Response.Redirect("WebForm1.aspx");
}
catch( Exception )
{
Label1.Text = ("Incorrect UserName/Password");
Label1.Visible = true;
}
txt_us.Text = "";
txt_pwd.Text = "";
}
public bool loginmethod(string UserName,string Password)
{
TrackDataEntities1 td = new TrackDataEntities1();
splogin1_Result sp = td.splogin1(UserName, Password).FirstOrDefault();
if(sp.Password==txt_pwd.Text)
{
return true;
}
else
{
return false;
}
}
Now there is two users .. admin and user . Now i want when admin login then with their id and password then he see some values from this list and when user login then he will see some values from this list for example when admin login then he may able to
see only Factory value and when user login then he able to see all values except factory
how i do this ?