<form>标签为表单标签。如果有数据提交到服务器中,则需要将<input> 、<textarea>、<select>等表单元元素放到form中;
一、<input>标签
1.<form action="register.aspx"><form>标签是提交给服务器,如果没有提交给服务器,可以不写;action元素为提交的服务器页面;
2.<input type="text"/>添加一个textbox,<input type="submit">添加一个提交按钮,<input type="file">添加一个浏览文件的控件,<input type="image" src="1.jpg">添加一个图片按钮,<input type="password">添加一个文本框输入的东西以点的方式显示,还有button,checkbox等
3.<input type="button" value="确定">;
4.<input type="text" size="100" value="123",maxlength="12" readonly="readonly"/>显示一个值为123的,长度为12的只读的textbox;
5.<input type="checkbox" checked="checked" />
6.radio:相同name的为一组,不同的radio设定不同的value值
7.image:使用src属性来设置图片的地址
8.file:使用file,则form的entype必须设置为multipart/form-data、method属性为POST
二、<select>标签:用来创建类似winform中的ComboBox或者ListBox
1.怎样来区分到底是表示的combobox还是ListBox
(1)如果size属性大于1就是ListBox,否则就是ComboBox
(2)<select multiple>或者<select multiple="multiple">那么就是可以多选的ListBox
2,select中的每一项用<option>来表示;size来显示几个Item;
3,<option value="1"/>即ValueMember
4.<option value="2">北京</option>
5<select>
<optgroup lable="山东省">
<option>济南</option>
<option>临沂</option>
</optgroup>
</select>
三、<textarea>:设置多行多列的TextBox
1.<textarea cols="100" rows="10">这里是设置的初值</textarea>
四、其他
1.<lable>
(1) <lable for="name">姓名</lable>< input id="name" type="text"/>
2.<fieldset>相当于winform中的groupbox
<fieldset>
<legend>常用</legend>
<input type="text"></input>
<input type="text"></input>
<input type="text"></input>
</filedset>