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

{

香港2GB内存DIYVM2核(¥50月)香港沙田CN2云服务器

DiyVM 香港沙田机房,也是采用的CN2优化线路,目前也有入手且在使用中,我个人感觉如果中文业务需要用到的话虽然日本机房也是CN2,但是线路的稳定性不如香港机房,所以我们在这篇文章中亲测看看香港机房,然后对比之前看到的日本机房。香港机房的配置信息。CPU内存 硬盘带宽IP价格购买地址2核2G50G2M1¥50/月选择方案4核4G60G3M1¥100/月选择方案4核8G70G3M4¥200/月选择...

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

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

PIGYun月付14.4元起,美国洛杉矶/韩国VPS七月6折

PIGYun是成立于2019年的国人商家,提供香港、韩国和美西CUVIP-9929等机房线路基于KVM架构的VPS主机,本月商家针对韩国首尔、美国洛杉矶CUVIP-AS29、GIA回程带防御等多条线路VPS提供6-8.5折优惠码,优惠后韩国首尔CN2混合BGP特惠型/美国洛杉矶GIA回程带10Gbps攻击防御VPS主机最低每月14.4元起。下面列出几款不同机房VPS主机配置信息,请留意不同优惠码。...

asp服务器为你推荐
futureshopgloway是什么牌子公司网络被攻击公司的一个员工手机中病毒了,今天公司网络被攻击大家的手机都上不了网,说是有人在扫描我们的无线网,刘祚天Mc浩然的资料以及百科谁知道?rawtoolsU盘显示是RAW格式怎么办同ip域名同IP网站具体是什么意思,能换独立的吗www.hyyan.comDOTA6.51新手选什么英雄为好,请详细讲述出装备顺序,加点顺序,以及注意事项。谢谢dadi.tvapple TV 功能介绍本冈一郎本冈一郎有副作用吗?主要有什么呢?本冈一郎本冈一郎到底有效果吗?有人用过吗?邯郸纠风网河北邯郸有几个县个名单非法集资
域名服务器是什么 openv NetSpeeder 英文站群 100m免费空间 193邮箱 cdn联盟 服务器是干什么的 umax120 台湾谷歌 优酷黄金会员账号共享 腾讯总部在哪 smtp虚拟服务器 智能dns解析 免费的域名 谷歌台湾 学生服务器 云销售系统 开心online 香港ip 更多