<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>
e.g. Car Truck Bike Drink Factory
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; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)