Wahstyle.css File
Body
{
Background-color: Aqua;
}
. Tab
{
Background-color: yellow;
}
. Txtlogin
{
Border-top-width: 0px;
Border-left-width: 0px;
Border-right-width: 0px;
Border-bottom-width: 1px;
Border-bottom-color: black;
Background-color: yellow;
}
Wahjs. JS File
// JScript File
Window. onload = load;
Function load ()
{
VaR mycss = Document. getelementbyid ("mycss ");
Mycss. setattribute ("href", "CSS/wahstyle.css ");
VaR txtname = Document. getelementbyid ("textbox1 ");
Txtname. attachevent ('onkeypress ', nameenter );
Txtname. Focus ();
}
Function nameenter ()
{
If (event. keycode = 13)
{
VaR txtpass = Document. getelementbyid ("textbox2 ");
Txtpass. Focus ();
}
}
// Login. ASPX page
<% @ Page Language = "C #" autoeventwireup = "true" codefile = "default. aspx. cs" inherits = "_ default" %>
<! Doctype HTML public "-// W3C // DTD
XHTML 1.0 transitional // "" http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd ">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head runat = "server">
<Title> No title page </title>
<Link id = "mycss" rel = "stylesheet" type = "text/CSS"/>
<Script language = "JavaScript" src = "JS/wahjs. js"> </SCRIPT>
<Script language = "JavaScript" type = "text/JavaScript">
Function mysubmit ()
{
If (event. keycode = 13)
{
_ Dopostback ("button1 ","");
}
}
</SCRIPT>
</Head>
<Body>
<Form ID = "form1" runat = "server">
<Div>
<Table class = "tab">
<Tr>
<TD>
Name
</TD>
<TD>
<Asp: textbox id = "textbox1" cssclass = "txtlogin" runat = "server"> </ASP: textbox>
</TD>
</Tr>
<Tr>
<TD>
Password
</TD>
<TD>
<Asp: textbox id = "textbox2" onkeypress = "mysubmit ();" cssclass = "txtlogin" runat = "server"> </ASP: textbox>
</TD>
</Tr>
<Tr>
<TD>
</TD>
<TD>
& Nbsp;
<Input id = "button1" runat = "server" onserverclick = "button2_serverclick" type = "button"
Value = "login"/> </TD>
</Tr>
</Table>
</Div>
<Asp: dropdownlist id = "dropdownlist1" runat = "server" width = "0px" autopostback = "true">
</ASP: dropdownlist>
</Form>
</Body>
</Html>
//. CS File
Http://download.csdn.net/source/670982
Using system;
Using system. Data;
Using system. configuration;
Using system. Web;
Using system. Web. Security;
Using system. Web. UI;
Using system. Web. UI. webcontrols;
Using system. Web. UI. webcontrols. webparts;
Using system. Web. UI. htmlcontrols;
Public partial class _ default: system. Web. UI. Page
{
Protected void page_load (Object sender, eventargs E)
{
}
Protected void button2_serverclick (Object sender, eventargs E)
{
Response. Write ("name:" + this. textbox1.text + "Pass:" + this. textbox2.text );
}
}