Connect the database with the ASP.net, do the login page, how to get it.
Way:
Using system.data.sqlclient;//Remember to add a reference to
private bool Login (string sno,string sname)
{
SqlConnection con = new SqlConnection ("Data source= database connection; Initial catalog=stu_table; User Id=sa; password=123456789 ");
Con. Open ();
String sql = string. Format ("SELECT count (*) from Student where sno= ' {0} ' and Sname= ' {1} '", sno,sname);//Here you change yourself, do not know what you use login, account password do not know what field you use, For the time being, you use your number and name to login
SqlCommand com = new SqlCommand (sql, con);
int flag = (int) com. ExecuteScalar ();
Con. Close ();
if (Flag > 0)
{return
true;
}
return false;
}
Put the above code in the Login.aspx.cs inside, where you log on to call this function, pass the login account and password come in on the line.
Returns True if the login is successful, otherwise it returns false
Landing success you can jump to your page with the following statement
Response.Redirect ("Inside You jump URL");
Landing failure You can hint
Response.Write ("<script> alert (' Account password error ');</script>");
The logic of the above can not write, then there is no way, the children will be
Database connection: This you change, general use. Say, you can also open your own database to see.
Question: How to implement the mouse following event and the binding of the scroll bar.
Mouse following events in the body height, want to follow the picture to a certain position after not change, is why.
The code is as follows:
<!
DOCTYPE html>
Reply:
Look here: Var x=e.pagex,y=e.pagey;