TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Mike Simo
NA
17
12.5k
form and enter key on keybord
Jun 8 2014 8:29 AM
Hi
i have many form in my website but the enter key on my keyboard its not working with those forms as since i click on enter key its just show the same form until i click on the form btn to processing the login process
public partial class login : System.Web.UI.Page
{
string sc = ConfigurationManager.ConnectionStrings["BeravaConnectionString"].ConnectionString.ToString();
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Loginbtn_Click(object sender, EventArgs e)
{
SqlConnection log = new SqlConnection(ConfigurationManager.ConnectionStrings["BeravaConnectionString"].ConnectionString);
log.Open();
string checkuser = "Select count(*) from UserInfo where UID='" + usrnamlogintxtbx.Text + "'";
SqlCommand cmd = new SqlCommand(checkuser, log);
int temp = Convert.ToInt32(cmd.ExecuteScalar().ToString());
log.Close();
if (temp == 1)
{
log.Open();
string checkpasswordquery = "Select Password from UserInfo where UID='" + usrnamlogintxtbx.Text + "'";
SqlCommand passcom = new SqlCommand(checkpasswordquery, log);
string password = passcom.ExecuteScalar().ToString().Replace(" ","");
if (password == usrnamloginpassbx.Text)
{
Session["UsrNme"] = usrnamlogintxtbx.Text;
Response.Redirect("User panel.aspx");
}
else
{
passwronglbl.Text = "Password is incorrect";
}
}
else {
wronglogusernamelbl.Text = "Invalid User Name";
}
}
}
}
Reply
Answers (
1
)
how to assign a role to access only a particular page in asp
How to connect to remote server?