控件大学生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)

{

香港物理服务器 E5-2660v2 16G 500GSSD 增送20G防御 688/月 华纳云

#年终感恩活动#华纳云海外物理机688元/月,续费同价,50M CN2 GIA/100M国际大带宽可选,超800G 防御,不限流华纳云成立于2015年,隶属于香港联合通讯国际有限公司。拥有香港政府颁发的商业登记证明,作为APNIC 和 ARIN 会员单位,现有香港、美国等多个地区数据中心资源,百G丰富带宽接入,坚持为海内外用户提供自研顶级硬件防火墙服务,支持T B级超大防护带宽,单IP防护最大可达...

Hostio€5/月KVM-2GB/25GB/5TB/荷兰机房

Hostio是一家成立于2006年的国外主机商,提供基于KVM架构的VPS主机,AMD EPYC CPU,NVMe硬盘,1-10Gbps带宽,最低月付5欧元起。商家采用自己的网络AS208258,宿主机采用2 x AMD Epyc 7452 32C/64T 2.3Ghz CPU,16*32GB内存,4个Samsung PM983 NVMe SSD,提供IPv4+IPv6。下面列出几款主机配置信息。...

选择Vultr VPS主机不支持支付宝付款的解决方案

在刚才更新Vultr 新年福利文章的时候突然想到前几天有网友问到自己有在Vultr 注册账户的时候无法用支付宝付款的问题,当时有帮助他给予解决,这里正好顺带一并介绍整理出来。毕竟对于来说,虽然使用的服务器不多,但是至少是见过世面的,大大小小商家的一些特性特征还是比较清楚的。在这篇文章中,和大家分享如果我们有在Vultr新注册账户或者充值购买云服务器的时候,不支持支付宝付款的原因。毕竟我们是知道的,...

asp服务器为你推荐
蓝瘦香菇被抢注蓝瘦香菇这梗是怎么火起来的?怎么觉得火得莫名其妙?ip购买如何购买.com的网站?ip购买不同的ID不同的IP买同一个店铺同样的商品属于虚假交易吗?2020双十一成绩单2020年河南全县初二期末成绩排名?access数据库什么是ACCESS数据库bbs.99nets.com怎么制作RO单机钟神发跪求钟神发名言出处,A站大神看过来www.55125.cnwww95599cn余额查询www.299pp.com免费PP电影哪个网站可以看啊hao.rising.cn我一打开网页就是瑞星安全网站导航,怎么修改?
免费网站空间 香港主机租用 com域名抢注 buyvm 安云加速器 56折 12u机柜尺寸 gspeed 阿里校园 免费申请网站 卡巴斯基破解版 深圳域名 主机返佣 97rb 广州主机托管 美国主机侦探 accountsuspended 游戏服务器 paypal兑换 tracert 更多