你正在创建一个 Web 窗体。这个 Web 窗体使用 FormView 控件让用户编辑数据库的一行记录。用户单击 FormView 控件的更新按钮时,应用必须验证用户是否为所有字段都输入了值。为此,你需要确保,如果用户没有为所有字段都输入值,则 Web 窗体并不更新数据。你应该使用下面那个代码段达到这个目的?()
A.
B.
C.
D.
A.
B.
C.
D.
第1题
A.
B.
C.
D.
第3题
A.在自定义控件代码中为Login按钮增加事件处理代码。
B.在自定义控件所在的Web窗体代码中为Login按钮增加事件处理代码。
C.在自定义控件所在的Web窗体的Page_Load方法中增加代码段去设置TextBox和Button控件的可见性。
D.在自定义控件的Page_Load方法中增加代码段去设置TextBox和Button控件的可见性。
第4题
A.增加一个CompareValidator控件到Web窗体。设置它的ControlToValidate属性值为txtDate; 设置它的Type属性值为Date;设置它的Operator属性值为DataTypeCheck。
B. 增加一个RangeValidator控件到Web窗体。设置它的ControlToValidate属性值为txtDate;设 置它的Type属性值为Date;设置它的MinimumValue属性值为01/01/1900;MaximumValue 属性值为当前日期。
C. 增加一个CustomValidator控件到Web窗体。设置它的ControlToValidate属性值为txtDate; 然后在partial 类写一个返回Boolean值的日期验证方法。然后设置ClientValidationFunction 属性值为刚才方法的名称。
D. 增加一个RegularExpressionValidator控件到Web窗体。设置它的ControlToValidate属性值为 txtDate;设置ValidationExpression属性值为验证用户输入数据格式为nn-nn-nnnn的正则表 达式,其中n代表从0到9的数字。
第5题
A. protected void Page_Error(object sender, EventArgs e) { lblResults.Text = e.ToString();e=null;}
B. protected void Page_Error(object sender, EventArgs e) { lblResults.Text =Server.GetLastError().ToStri();Server.ClearError();}
C. protected void Page_Error(object sender, EventArgs e) Response.Write(e.ToString());e=null;}
D. protected void Page_Error(object sender, EventArgs e) Response.Write(Server.GetLastError().ToString()); Server.ClearError();}
第6题
A.
B.
C.
D.
第7题
A. 增加一个SiteMapDataSource控件到Web窗体,并且绑定到TreeView 控件。
B. 增加一个SiteMapPath控件到Web窗体,并且绑定到TreeView控件。
C. 嵌入上述站点导航XML定义到Web.sitemap文件的SiteMap节点内。
D. 嵌入上述站点导航XML定义到Web.config文件的AppSettings节点内。
E. 设置SiteMapDataSource 控件的StartingNodeUrl属性值为~/Marketing.aspx。
F. 设置SiteMapPath 控件的SkipLinkText属性值为Sales。
第8题
A.WebAuditEvent
B. WebEventManager
C. WebBaseEvent
D. WebRequestEvent
第9题
A.创建ContosoUI控件为Web控件库。
B.创建ContosoUI控件为Web用户控件。
C.在VisualStudio.NET工具栏中,浏览并选择ContosoUI.ascx。
D.在VisualStudio.NET工具栏中,浏览并选择ContosoUI.dll。