控件大学生ASP试题库 第2章 Web服务器窗体控件

asp服务器  时间:2021-03-14  阅读:()

ASP.NET应用程序设计

第二章Web窗体服务器控件

一选择题

【1】Web窗体控件标记采用 格式。

A、 HTML B、XML C、UML D、HTTP

【2】对Button控件 以下哪个元素不是必需的 

A、 asp:Button B、 ID C、 runat=server D、 Text

【3】以下为鼠标跟随信息的属性是 

A、MouseFollow B、 ToolTip C、 TabIndex D、AccessKey

【4】以下表示快捷键的属性为 

A、 AccessKey B、 ShortcutKey C、 ShortcutMenu D、 TabIndex

【5】控件的快捷键一般与 键组合使用。

A、 Ctrl B、 Shift C、Alt D、 Tab

【6】表示控件是否可用的属性是 

A、 Visible B、 Enable C、 Enabled D、 IsVisible

【7】密码输入使用的控件是 

A、 Password B、 Label C、 Pwd D、 TextBox

【8】获取或设置文本框的输入方式应设置其 属性。

A、 TextMode B、 Text C、 InputMode D、AutoPostBack

【9】单行文本输入框 TextBox控件的TextMode属性应设置为 

A、 SingleLine B、 Password C、MultiLine D、 OneLine

【10】多行文本输入框 TextBox控件的TextMode属性应设置为 

A、 SingleLine B、 Password C、MultiLine D、MultiRows

【11】密码输入框 Text Box控件的TextMode属性应设置为 

A、 SingleLine B、 Password C、MultiLine D、 Encryption

【12】TextBox控件设置文本是否自动换行的属性是 

A、 TextMode B、 Rows C、MultiLine D、Wrap

【13】TextBox控件设置指定一行能输入的最多字符数的属性是 

A、 TextMode B、 Columns C、MultiLine D、MaxLength

【14】TextBox控件的TextMode=S ingleLine时指定可输入最多字符数的属性是 

A、 Rows B、 Columns C、MultiLine D、MaxLength

【14】TextBox控件的AutoP o stBac k属性指定 

A、输入的文本改变时是否自动回传 B、输入焦点离开时是否自动回传

C、页面加载时是否自动回传 D、键盘按键弹开时是否自动回传

【15】 I mag eButton控件的I mag eUrl属性获取或设置按钮图片 

A、所在服务器上的物理路径 B、所在服务器上的相对路径

C、所在客户端的文件路径 D、所在Internet的地址

【16】Button控件的 属性值是传递给Command事件的参数携带的。

A、 CommandName B、 Text C、 OnClick D、 ToolTip

【17】Button控件在客户端执行的脚本应通过 属性调用。

A、 OnClick B、 Click C、 OnClientClick D、 ClientClick

【18】Button控件在服务器端执行的代码应通过 事件调用。

A、 OnClick B、 Click C、 OnClientClick D、 ClientClick

【19】以下对Hyp erL ink控件描述不正确的是 。

A、既可以显示文本也可以显示图像 B、显示的文本必须设置在其Text属性

C、显示的图片必须设置在其ImageUr l属性 D、 ImageUrl属性优先级比Text属性高

【20】以下对Hyp erL ink控件描述不正确的是 。

A、设置Text属性而不设置ImageUr l属性时超级链接显示为文本

B、设置ImageUr l属性而不设置Text属性时超级链接显示为图片

C、 同时设置Text和ImageUrl属性时超级链接显示为文本

D、 同时设置Text和ImageUr l属性时超级链接显示为图片

【21】Hyp er Link显示图像必须设置其 属性。

A、 Text B、NavigateUrl C、 Target D、 ImageUrl

【22】以下对Hyp erL ink控件描述不正确的是 。

A、点击超级链接会引发其服务器端的OnClick事件

B、 同时设置Text和ImageUrl属性时 ImageUrl优先

C、 同时设置Text和ImageUrl属性时 Text文本成为鼠标跟随属性

D、若显示文本设置Text属性或将文本放置在开始标记和结束标记之间。

【23】点击Hyp erL ink要在新窗口中打开目标页面需将Targ et属性设置为 。

A、 _blank B、 _top C、 _parent D、 _new

【24】点击Hyp erL ink要在父框架中显示目标页需将Targ et属性设置为 。

A、 _blank B、 _top C、 _parent D、 _father

【25】点击Hyp erL ink要在当前框架中显示目标页需将Targ et属性设置为 。

A、 _current B、 _now C、 _here D、 _self

【26】点击Hyp erL ink要在最顶层框架中显示目标页需将Targ et属性设置为 。

A、 _blank B、 _top C、 _parent D、 _tip

【27】点击图片时链接到另外一个页面不触发服务器端代码应使用 控件。

A、 Image B、 HyperLink C、 ImageButton D、 LinkButton

【28】点击图片时触发服务器端代码应使用 控件。

A、 Image B、 HyperLink C、 ImageButton D、 LinkButton

【29】 I mag e图片不能显示时替换的文字应设置在 属性。

A、 Text B、 ToolTip C、AlternateText D、 ImageUrl

【30】单选按钮Radio Button被选中后其 属性被设置为true。

A、 Radio B、 Radioed C、 Check D、 Checked

【31】单选按钮Radio Button的文本放到小圆点之后应设置其 属性。

A、 Text B、 TextAlign C、HorizontalAlign D、VerticalAlign

【32】设置2个单选按钮Radio Button互斥应 。

A、 自动互斥无需特殊设置 B、必须通过服务器代码实现

C、将两个按钮的GroupName属性设置为相同的字符串

D、将两个按钮的Checked属性设置为互斥

【33】复选框Chec kBox的文本放到勾选框之后应设置其 属性。

A、 Text B、 TextAlign C、HorizontalAlign D、VerticalAlign

【34】Radio ButtonL is t中表示列表中项的集合的属性是 。

A、 Items B、 Rows C、 Columns D、 Radios

【35】Radio ButtonL is t中用于布局项的列数的属性是 。

A、 Columns B、 ColumnsCount C、 ColumnCount D、 RepeatColumns

【36】Radio ButtonL is t中表示项的布局方向的属性是 。

A、 RepeatDirection B、 RepeatMode C、 RepeatLayout D、 Direction

【37】Radio ButtonL is t中表示项的布局方式的属性是 。

A、 RepeatDirection B、 RepeatMode C、 RepeatLayout D、 Direction

【38】Radio ButtonL is t中用于控制文本相对于控件的显示位置的属性是 。

A、 Text B、Align C、 TextPosition D、 TextAlign

【39】Radio ButtonL is t选中项的索引是 。

A、 Index B、 SelectedItem.Index C、 SelectedItem.ItemIndex D、 SelectedIndex

【40】Radio ButtonL is t的选中项是 。

A、 Selected B、 SelectedItem C、 SelectedValue D、 SelectedIndex

【41】Radio ButtonL is t的选中项的值是 。

A、 SelectedItem.Text B、 SelectedItem C、 SelectedValue D、 SelectedText

【42】CheckBox List中表示列表中项的集合的属性是 。

A、 Items B、 Rows C、 Columns D、 Radios

【43】CheckBox List中用于布局项的列数的属性是 。

A、 Co lumns B、 ColumnsCount C、 ColumnCount D、 RepeatColumns

【44】CheckBox List中表示项的布局方向的属性是 。

A、 RepeatDirection B、 RepeatMode C、 RepeatLayout D、 Direction

【45】CheckBox List中表示项的布局方式的属性是 。

A、 RepeatDirection B、 RepeatMode C、 RepeatLayout D、 Direction

【46】CheckBox List中用于控制文本相对于控件的显示位置的属性是 。

A、 Text B、Align C、 TextPosition D、 TextAlign

【47】CheckBox List索引最小的选中项索引是 。

A、 Index B、 SelectedItem.Index C、 SelectedItem.ItemIndex D、 SelectedIndex

【48】CheckBox List索引最小的选中项是 。

A、 Selected B、 SelectedItem C、 SelectedValue D、 SelectedIndex

【49】CheckBox List索引最小的选中项的值是 。

A、 SelectedItem.Text B、 SelectedItem C、 SelectedValue D、 SelectedText

【50】以下对Chec kBoxL is t描述正确的是 。

A、 RepeatDirection属性控制水平还是垂直排列 B、 SelectedItem为选中项

C、 S elec tedIndex为Chec kBox选中项的索引 D、 Chec kBox不可以选择多项

【51】判断Chec kBoxLis t的某项是否为勾选选中项 以下方法正确的是 。

A、判断该项的索引与CheckBoxList的SelectedIndex是否相等

B、判断该项与CheckBoxList的SelectedItem是否相等

C、判断该项的Chec ked属性是否为true

D、判断该项的Selected属性是否为true

【52】DropDownLis t的AutoP o s tBac k属性的默认值是 。

A、 true B、 false C、 0 D、制定的选中项索引

【53】将Lis t Box设置为单选应设置属性 。

A、 SingleSelection=true B、 SingleMode=true

C、 SelectionMode=OnlyOne D、 SelectionMode=Single

【54】将Lis t Box设置为多选应设置属性 。

A、 SingleSelection=false B、 SingleMode=false

C、 SelectionMode=Multiple D、 SelectionMode=MultiSelection

【55】按钮的OnClientC lick代码在 执行。

A、服务器端B、浏览器端C、Web网络上D、 IIS中

【56】要让Button按钮可用但不执行服务器端代码应 。

A、不添加Click事件B、 Click事件函数中不写任何代码

C、 OnClientClick中代码返回false D、 Enabled属性置为false

【57】RequiredF ieldValidator中指定要验证的控件的属性是 。

A、 Contro lToValidate B、 Control C、 Validate D、 RequiredContro l

【58】验证控件中验证无效时显示错误提示信息的属性是 。

A、 Text B、 Control C、Message D、 ErrorMessage

【59】使用RequiredF ie ldValidator验证控件验证失败时将验证程序内容动态添加到页面不需设置的属性是 。

A、 ControlToValidate B、 ErrorMessage C、 Display D、 Text

【60】RangeValidator验证控件表示数据类型的属性是 。

A、 Type B、 DataType C、 Display D、 ValueType

【61】Tab le控件中表示行的集合的属性是 。

A、 Items B、 Rows C、 TableRow D、 TableRows

【62】Tab le控件中的一行是 类的对象。

A、 Items B、 Rows C、 TableRow D、 TableRows

【63】Tab le控件中每行都包含由单元格所组成的集合这个属性是 。

A、 C ells B、 Co lumns C、 TableCell D、 Tab leC ells

【64】Tab le控件中每个单元格是 类的对象。

A、 Cell B、 Co lumn C、 Table Cell D、 TableCo lumn

【65】Tab le控件中的某个单元格跨多行需要设置其 属性为所跨行数。

A、 HorizontalSpan B、 VerticalSpan C、 ItemSpan D、 RowSpan

【66】Tab le控件中的某个单元格跨多列需要设置其 属性为所跨列数。

A、 HorizontalSpan B、 VerticalSpan C、 ColumnSpan D、 CellSpan

【67】如下表所示结构的Table控件第0行的列数是 。

A、 1 B、 3 C、 4 D、 5

【68】如下表所示结构的Table控件第1行的列数是 。

A、 1 B、 2 C、 3 D、 4

【69】Calendar控件选中的时间是 数据类型的。

A、 string B、 Date C、 Calendar D、 DateTime

【70】表示Calendar控件的选中时间的属性是 。

A、 SelectedDate B、 SelectedTime C、 SelectedCalendar D、 SelectedDateTime

【71】AS P.NET上传文件所使用的控件是 。

A、 FileUpload B、 File C、 Stream D、 FileStream

【72】B/S结构应用程序上传文件所使用的编码是 。

A、二进制B、 Base64 C、 Unicode D、UTF-8

【73】 ID为fu的FileUpload控件获取其上传的文件大小的方法是 。

A、 fu.Length B、 fu.FileLength

C、 fu.PostedFile.Length D、 fu.PostedFile.ContentLength

【74】 ID为fu的FileUpload控件将选中的文件保存到服务器路径s的方法是 。

A、 fu.SaveAs(s) B、 fu.Upload(s)

C、 fu.PostedFile.SaveAs(s) D、 fu.PostedFile.Up load(s)

【75】 ID为fu的FileUpload控件获取客户端上选中文件的路径的方法是 。

A、 fu.ClientPath B、 fu.FileName

C、 fu.PostedFile.ClientPath D、 fu.PostedFile.FileName

【76】AS P.NET 中默认的上传文件文件大小的限制是 。

A、 1M B、 4M C、 10MD、 4G

【77】ASP.NET 中修改默认的上传文件文件大小的限制为10M需要在w eb.c onfig文件的<System.Web>中增加 。

A、 <httpRunt ime maxReques tL ength="10240" />

B、 <Up loadF ile maxLength="10240" />

C、 <httpRuntime maxL ength="10240" />

D、 <httpRuntime maxReques tL ength="10 M" />

二、 问答题

【1】简述TextBox控件的TextMode属性及其取值的意义。

【2】简述Hyp erL ink控件的用途和用法。

【3】简述HyperLink控件的Navigate Ur l和Target属性的意义 以及Target取值的意义。

【4】列举4个基本数据绑定控件并简要说明其功能。

【5】列举6种常有服务器端验证控件并说明其功能。

【6】使用RangeValidator验证控件需要设置哪些属性并说明属性的作用。

【7】使用CompareValidator验证控件需要设置哪些属性并说明属性的作用。

【8】使用RegularExpres sionValidator验证控件需要设置哪些属性并说明属性的作用。

【9】使用CustomValidator验证控件需要设置哪些属性和事件并说明属性的作用。

【10】说明Validat ionSummary验证控件的哪些属性取哪些值时各为何种提醒方式

【11】简述上传文件保存到服务器硬盘的优点和缺点。

【12】简述B/S结构程序与C/S结构程序相比在文件传输对安全性的特殊要求。

三程序改错题

【1】编程实现将学历{初中高中大学研究生博士}绑定到Radio ButtonL is t控件rblEduc ation。如下程序无法显示学历说明错误原因并改正。protected void BindEducation()

{

ArrayList arr=new ArrayList();arr.Add("初中");arr.Add("高中");

arr.Add("大学");arr.Add("研究生");arr.Add("博士");rblEduc ation.DataSourc e=arr;

}

【2】在页面的P ag e_Lo ad中编程实现将学历{初中高中大学研究生博士}绑定到Radio Button List控件rblEduc ation。如下程序选择一个学历后取得的选中项总为空值说明错误原因并改正。protected void Page_Load(object sender,EventArgs e)

{

ArrayList arr=new ArrayList();arr.Add("初中");arr.Add("高中");arr.Add("大学");arr.Add("研究生");arr.Add("博士");rblEduc ation.DataSourc e=arr;rblEduc ation.DataBind();

}

【3】编程实现将键/值对绑定到Radio Button List控件rblEduc ation。如下程序无法正确显示学历说明错误原因并改正。protected void BindEducation()

{

ArrayList arr=new ArrayList();arr.Add(new Dic tionaryEntry(0, "初中"));arr.Add(new Dic tionaryEntry(1, "高中"));arr.Add(new Dic tionaryEntry(2, "大学"));arr.Add(new Dic tionaryEntry(3, "研究生"));arr.Add(new Dic tionaryEntry(4, "博士"));rblEduc ation.DataSourc e=arr;rblEduc ation.DataBind();

}

【4】编程实现将键/值对绑定到Radio Button List控件rblEduc ation。如下程序无法正确显示学历说明错误原因并改正。protected void BindEducation()

{

ArrayList arr=new ArrayList();arr.Add(new Dic tionaryEntry(0, "初中"));arr.Add(new Dic tionaryEntry(1, "高中"));arr.Add(new Dic tionaryEntry(2, "大学"));arr.Add(new Dic tionaryEntry(3, "研究生"));arr.Add(new Dic tionaryEntry(4, "博士"));rblEduc ation.DataSourc e=arr;rblEduc ation.DataSourc e=arr;

rblEduc ation.DataValueF ie ld="Key";

}

【5】在页面的P age_Load中编程实现将键/值对绑定到Radio ButtonL is t控件rblEduc ation。如下程序选择一个学历后取得的选中项总为空值说明错误原因并改正。protected void Page_Load(object sender,EventArgs e)

{

ArrayList arr=new ArrayList();arr.Add(new Dic tionaryEntry(0, "初中"));arr.Add(new Dic tionaryEntry(1, "高中"));arr.Add(new DictionaryEntry(2, "大学"));arr.Add(new Dic tionaryEntry(3, "研究生"));arr.Add(new Dic tionaryEntry(4, "博士"));rblEduc ation.DataSourc e=arr;rblEduc ation.DataValueF ie ld="Key";rblEduc ation.DataTextF ie ld="Value";rblEduc ation.DataBind();

}

【6】页面上有ID为cbl的Chec kBoxList控件其AutoPostBac k属性为true。勾选其中某项后将所有选中项文本显示在ID为lbl的Label控件中。 以下程序不能正确取得所有选中项说明出错原因并改正。protected void cbl_SelectedIndexChanged(object sender,EventArgs e)

{string str="";for(int i=0; i<cbl.Items.Count; i++)

{if(i==cbl.SelectedIndex)s tr+=s tring.F ormat("{0}&nbsp;", item.Text);

}lb l.Text=s tr;

}

【7】页面上有ID为cbl的Chec kBoxList控件其AutoPostBac k属性为true。勾选其中某项后将所有选中项文本显示在ID为lbl的Label控件中。 以下程序不能正确运行说明出错原因并改正。protected void cbl_SelectedIndexChanged(object sender,EventArgs e)

{string str="";foreach(ListItem item in cbl.Items)

{if(item.Checked)s tr+=s tring.F ormat("{0}&nb sp;", item.Text);

}lb l.Text=s tr;

}

【8】以下方法为在Table控件的行对象row中增加一个单元格单元格文本为strCellText行跨度和列跨度分别为nRow Span和nColSpan。程序执行后该单元格并未加入到行对象说明以下程序错误原因并改正。private void AddCell(TableRow row, string strCellText, int nRowSpan, int nColSpan){

TableCell cell=new TableCell();c ell.Text=strCellText;if(nRow Span>1)cell.RowSpan=nRowSpan;if(nColSpan>1)c ell.Co lumnSpan=nColSpan;

}

【9】以下方法为在Table控件t中增加一行每行文本为strCellText中的字符串。程序执行后 t对象中并未增加新行说明以下程序出错原因并改正。private void AddRow(Table t,params string[] strCellText)

{

TableRow row=new TableRow();foreach(string str in strCellText)

{

TableCell cell=new TableCell();c ell.Text=str;row.Cells.Add(c ell);

}

}

四、程序填空题

【1】在页面的P age_Load中编程实现将键/值对绑定到Radio ButtonL is t控件rblEduc ation 阅读程序并填空。protected void Page_Load(object sender,EventArgs e)

{if( 1 )r eturn;

2 arr=new 2 ();arr. 3 (new 4 (0, "初中"));arr. 3 (new 4 (1, "高中"));arr. 3 (new 4 (2, "大学"));arr. 3 (new 4 (3, "研究生"));arr. 3 (new 4 (4, "博士"));rblEduc ation. 5 =arr;rblEduc ation. 6 =" 7 ";rblEduc ation. 8 =" 9 ";rblEduc ation.  10 ();

}

【2】页面上有两个TextBox控件tbName和tbAge分别表示姓名和年龄。要求姓

名不能为空年龄为无符号整数。 以下为使用JavaScript完成验证输入是否正确的函数IsInputCorrec t() 阅读并填空。

<script 1 =" 2 ">

3 IsInputCorrec t()

{if( 4 . 5 ("<%=tbNam e. 6 %>"). 7 =="")

{alert("姓名不能为空 ");return fals e;

}

8 s trAg e= 4 . 5 ("<%=tbAg e. 6 %>"). 7 ;var regInt= 9 ;if(!regInt. 10 (strAge))

{alert("年龄必须为一个整数 ");return fals e;

}return true;

}

</script>

【3】以下针对Tab le控件的两个方法代码根据注释阅读并填空。

/*功能在Table控件的行对象中增加一个单元格

* row增加的单元格所在行对象

* s trCellText该单元格填充的文本

*nRowSpan该单元格行跨度其数值可能不合法≤0

*nColSpan该单元格列跨度其数值可能不合法≤0 */private void AddCell(TableRow row, string strCellText, int nRowSpan, int nColSpan){

1 c ell=new 1 ();c ell. 2 =strCellText;if(nRow Span>1)c ell. 3 =nRowSpan;if(nColSpan>1)cell. 4 =nColSpan;row. 5 . 6 (cell);

}

/*功能在Table控件中增加一行

* t要增加的行所在Table控件

* s trCellText要增加的行每个单元格的文本为动态参数形参数量不确定 */private void AddRow(Table t, 7 string[] strCellText)

{

8 row=new 8 ();foreach(string str in strCellText)

{

Hostodo,美国独立日特价优惠,四款特价VPS云服务器7折,KVM虚拟架构,NVMe阵列,1核512M内存1Gbps带宽3T月流量,13.99美元/月,赠送DirectAdmin授权

Hostodo近日发布了美国独立日优惠促销活动,主要推送了四款特价优惠便宜的VPS云服务器产品,基于KVM虚拟架构,NVMe阵列,1Gbps带宽,默认分配一个IPv4+/64 IPv6,采用solusvm管理,赠送收费版DirectAdmin授权,服务有效期内均有效,大致约为7折优惠,独立日活动时间不定,活动机型售罄为止,有需要的朋友可以尝试一下。Hostodo怎么样?Hostodo服务器好不好?...

亚洲云-浙江高防BGP,至强铂金8270,提供自助防火墙管理,超大内存满足你各种需求

官方网站:点击访问亚洲云官网618活动方案:618特价活动(6.18-6.30)全站首月活动月底结束!地区:浙江高防BGPCPU:至强铂金8270主频7 默频3.61 睿频4.0核心:8核(最高支持64核)内存:8G(最高支持128G)DDR4 3200硬盘:40G系统盘+80G数据盘带宽:上行:20Mbps/下行:1000Mbps防御:100G(可加至300G)防火墙:提供自助 天机盾+金盾 管...

日本CN2独立物理服务器 E3 1230 16G 20M 500元/月 提速啦

提速啦的来历提速啦是 网站 本着“良心 便宜 稳定”的初衷 为小白用户避免被坑 由赣州王成璟网络科技有限公司旗下赣州提速啦网络科技有限公司运营 投资1000万人民币 在美国Cera 香港CTG 香港Cera 国内 杭州 宿迁 浙江 赣州 南昌 大连 辽宁 扬州 等地区建立数据中心 正规持有IDC ISP CDN 云牌照 公司。公司购买产品支持3天内退款 超过3天步退款政策。提速啦的市场定位提速啦主...

asp服务器为你推荐
汇通物流百世汇通快递需要多少运费美国互联网瘫痪如果全球网络瘫痪3分钟会造成多少损失急救知识纳入考试急救证容易拿到么?杨紫别祝我生日快乐周杰伦的祝我生日快乐这首歌有什么寓意或者是在什么背景下写的access数据库ACCESS数据库有什么用罗伦佐娜罗拉芳娜 (西班牙小姐)谁可以简单的介绍以下www.yahoo.com.hk香港有什么有名的娱乐门户网站吗?www.bbb551.comHUNTA551第一个第二个妹子是谁呀??haole012.com说在:012qq.com这个网站能免费挂QQ,是真的吗?hao.rising.cn电脑每次开机的时候,都会弹出“http://hao.rising.cn/?b=34” 但是这个时
美国虚拟主机推荐 济南域名注册 双线服务器租用 godaddy域名解析教程 dns是什么 国外主机 国外服务器网站 日志分析软件 godaddy优惠券 512au debian7 京东商城0元抢购 admit的用法 135邮箱 静态空间 adroit 佛山高防服务器 免费智能解析 卡巴斯基是免费的吗 免费外链相册 更多