HTML code:
<% @ Page Language = "C #" autoeventwireup = "true" codefile = "default2.aspx. cs" inherits = "default2" %>
<! Doctype HTML public "-// W3C // dtd xhtml 1.0 transitional // en" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<HTML xmlns = "http://www.w3.org/1999/xhtml">
<Head runat = "server">
<Title> </title>
<Style type = "text/CSS">
. Tbx_txt
{
Border-width: 0px 0px 0px 0px;
Overflow: hidden;
}
</Style>
<Style type = "text/CSS">
. Watermarkedtextbox
{
Height: 16px;
Width: 168px;
Padding: 2px 2 2 2px;
Border: 1px solid # bebebe;
Background-color: # f0f8ff;
Color: Gray;
Font-size: 8pt;
Text-align: center;
}
. Watermarkedtextboxpsw
{
Background-position: center;
Height: 16px;
Width: 168px;
Padding: 2px 2 2 2px;
Border: 1px solid # bebebe;
Background-color: # f0f8ff;
Color: white;
Vertical-align: middle;
Text-align: right;
Background-image: URL (images/psw_wmark.png );
Background-repeat: No-Repeat;
}
. Normaltextbox
{
Height: 16px;
Width: 168px;
}
</Style>
<Script language = "JavaScript" type = "text/JavaScript">
Function focus (objname, watermarktext ){
OBJ = Document. getelementbyid (objname );
If (obj. value = watermarktext ){
OBJ. value = "";
OBJ. classname = "normaltextbox ";
If (obj. value = "User ID" | obj. value = "" | obj. value = NULL ){
OBJ. style. color = "black ";
}
}
}
Function blur (objname, watermarktext ){
OBJ = Document. getelementbyid (objname );
If (obj. value = ""){
OBJ. value = watermarktext;
If (objname! = "Txtpwd "){
OBJ. classname = "watermarkedtextbox ";
}
Else {
OBJ. classname = "watermarkedtextboxpsw ";
}
}
Else {
OBJ. classname = "normaltextbox ";
}
If (obj. value = "User ID" | obj. value = "" | obj. value = NULL ){
OBJ. style. color = "gray ";
}
}
</SCRIPT>
</Head>
<Body>
<Form ID = "form1" runat = "server">
<Div>
<Asp: textbox id = "textbox1" readonly = "true" runat = "server" cssclass = "tbx_txt"
Borderwidth = "0" textmode = "multiline"
TEXT = "ddddd"/>
<Br/>
<Br/>
</Div>
<Input type = "checkbox" name = "checkname"/>
<Input type = "checkbox" name = "checkname" value = "1"/>
<Input type = "checkbox" name = "checkname" value = "3"/>
<Input type = "checkbox" name = "checkname" value = "4"/>
<Input type = "checkbox" name = "checkname" value = "5"/>
<Input type = "checkbox" name = "checkname" value = "6"/>
<Br/>
<Input type = "radio" name = "radioname" value = "rad1"/>
<Input type = "radio" name = "radioname" value = "rad1"/>
<Input type = "radio" name = "radioname" value = "rad1"/>
<Input type = "radio" name = "radioname" value = "rad1"/>
<Input type = "radio" name = "radioname" value = "rad1"/>
<Asp: button id = "button1" runat = "server" onclick = "button#click" text = "button"/>
</Form>
</Body>
</Html>
C # code:
Using system;
Using system. Collections. Generic;
Using system. LINQ;
Using system. Web;
Using system. Web. UI;
Using system. Web. UI. webcontrols;
Public partial class default2: system. Web. UI. Page
{
Protected void page_load (Object sender, eventargs E)
{
}
Protected void button#click (Object sender, eventargs E)
{
Response. Write (request. Form ["checkname"]. tostring () + "<br/> ");
Response. Write (request. Form ["radioname"]. tostring ());
}
}