WebForm 简单控件、复合控件
简单控件:
Label:被编译成span
样式表里设置lable的高度: display:inline-block;
Text --文本
ForeColor --字体颜色
Visible --权限时使用
CssClass --样式表
Literal:无任何元素,只会在其位置上将Text内容完全展示出来(例如:输出js代码)
重要属性只有:Text --文本
TextBox: 不一定被编译成什么元素
属性:Text --文本
TextMode - 它设置为什么值,被编译后将会是不同的一些表单元素
SingleLine --文本框
MultiLine --文本域
Password --密码框
Number --只能是数字,可以点击上下三角号进行加减
Button: 被编译成提交按钮 submit
ImageButton:被编译成图片按钮 image,有提交功能
LinkButton:超链接模样的按钮,有提交按钮的作用。被编译的内容较复杂
属性:OnClientClick是执行客户端脚本(js),客户端执行优先级高于服务端
表单元素:
文本类: --简单控件
文本框:<input type="text" />
密码框:<input type="password" />
文本域:<textarea></textarea>
隐藏域:<input type="hidden" />
按钮类: --简单控件
普通按钮:<input type="button" value="按钮1" />
提交按钮:<input type="submit" value="提交" />
重置按钮:<input type="reset" value="重置" />
图片按钮:<input type="image" src="" />
选择类: --复合控件
单选框:<input type="radio" />
复选框:<input type="checkbox" />
下拉列表:<select>
<option></option>
</select>
文件选择:<input type="file" />
复合控件:
RadioButton: (例如:男/女)
两个radiobutton ,用groupname进行分组
设置默认选择项 checked="true"
表单中:radio 使用name进行分组
<input type="radio" id="nan" name="sex"><lable for="nan">男</lable>
<input type="radio" id="nv" name="sex"><lable for="nv">女</lable>
RadionButtonList:(必须使用)
默认就是一组
默认选中项: selected="true"
布局:属性可以设置垂直排列还是水平排列
复合控件三步:
1、将数据绑定上去(例如:民族表)
遍历:
RadionButtonList 内为空的
foreach(Nation n in list)
{
Listitem li =new Listitem(n.NationName,n.NationCode);
RadioButton1.Items.Add(li);
}
数据绑定:
if(!IsPostBack)
{
RadioButton1.DataSource=list;
RadioButton1.DataTextFiled="NationName";
RadioButton1.DataValueFiled="NationCode";
RadioButton1.DataBind();
}
2、设置默认选中项
RadioButton1.SelectedIndex=1;
RadioButton1.SelectedValue="N001";
3、将选中数据取出来
委托事件:
ListItem li=RadioButtonList1.SelectdItem;
Lable.Text=li.Value+","+li.Text;
CheckBoxList:(类似于RadionButtonList)
DropDownList:(类似于RadionButtonList)
WebForm 简单控件、复合控件的更多相关文章
- WebForm简单控件,复合控件
简单控件: 1.Label 会被编译成span标签 属性: Text:文本内容 CssClass:CSS样式 Enlabled:是否可用 Visible:是否可见 __________________ ...
- webform简单控件
表单元素: 文本类: text password textarea hidden text,password,textarea实现控件:textbox textmode属性选择password或m ...
- 2017年12月17日 ASP.NET 12个表单元素&&简单控件/复合控件
12个表单元素可以分为三大类 第一类:文本类 <input type = "text" /> //普通文本框 <input type = "passwo ...
- webform 简单控件
html中12个表单元素添加runat="server"后称为控件 Lable 编译之后是 <span></span> 属性:CssClass 编译成 c ...
- Webform(简单控件、复合控件)
一.简单控件: 1.label控件 <asp:Label ID="Label1" runat="server" Text="账 号:" ...
- WebForm 【简单控件】【表单元素】
一.HTML 表单元素复习 (1)文本类 文本框:<input type="text" name="" id="" value=&qu ...
- 【2017-05-18】WebForm的Repeater控件和一些简单控件
一.Repeater控件 1. <%@ %> - 这里面写一些声明和引用的 <% %> - 编写C#代码的 <%= %> - 往界面上输出一个变量的值 <% ...
- 【2017-05-18】WebForm的Repeater控件及简单控件
<%@ %> - 这里面写一些声明和引用的 <% %> - 编写C#代码的 <%= %> - 往界面上输出一个变量的值 <%# Eval("属性名 ...
- WebForm 常用控件
一.简单控件 1.Label(作用:显示文字) Web中: <asp:Label ID="Label1" runat="server" Text=&quo ...
随机推荐
- LintCode Search Insert Position
找出指定target的位置(没有此数时为按顺序应当位置). public class Solution { /** * param A : an integer sorted array * para ...
- bootstrap-4
html文档中,列表结构主要有三种:有序列表.无序列表和定义列表:<ul><li>.<ol><li>.<dl><dt><d ...
- Android-Cdma手机定位
对于Android CDMA手机获取当前位置,其实有更便利的办法,就是哄骗CdmaCellLocation.getBaseStationLatitude(),然则getBaseStationLatit ...
- 解决wamp的Apache服务器不能重启
由于工作需要,现在开始研究PHP语言.刚开始搭建服务器环境就困难重重啊.首先看了下配置说明,很复杂很复杂(超级想念Visual Studio).然后问了下群里的老鸟,他们都是安装WAMPServer环 ...
- 黄聪:说说JSON和JSONP,也许你会豁然开朗(转)
前言 由于Sencha Touch 2这种开发模式的特性,基本决定了它原生的数据交互行为几乎只能通过AJAX来实现. 当然了,通过调用强大的PhoneGap插件然后打包,你可以实现100%的Socke ...
- Spring AOP 完成日志记录
Spring AOP 完成日志记录 http://hotstrong.iteye.com/blog/1330046
- AX Dynamic 2012 tabletype:TempDB使用
LedgerJournalTmp ledgerJournalTmpJoin; LedgerJournalTransAccrual this.takeOwnershipOfTempTable(ledge ...
- ssh整合(http://blog.csdn.net/songanling/article/details/22454973)
http://blog.csdn.net/songanling/article/details/22454973
- link
public IEnumerable InsuranceSearch(InsuranceSC sc, out int TotalCount) { var data = from q in Insura ...
- C#中抽象类和接口
下面是我做的测试: using System; using System.Collections.Generic; using System.Linq; using System.Text; usin ...