submitOrderButton的主事件处理程序命名为submitOrderButton_Click,并在服务器上运行。一个名为verifyBeforeSubmit()的客户端函数显示了要求用户校验提交订单意愿的对话框。
3 \ B3 I& x3 O' ^! d您需要确保verifyBeforSubmit()在submitOrderButton_Click之前运行。您应该怎么办?(C)
& X" D. U' q* o) iA. 将HTML元素修改如下: & b7 D' |% ]* A2 u! x& v/ j, b/ T
* a% r c% r) C3 C
B. 将HTML元素修改如下:
$ Y- w' D3 @ y% [( [" S, a
; [! \: y7 z4 X/ kC. 将下列代码添加到OrderVerify.aspx的Page.Load事件管理程序: ' Q& M8 l0 O- r# m
subitOrderButton.Attributes.Add(“onclick”,”verifyBeforeSubmit();”) / _; t, w0 X$ f9 z
D. 将下列代码添加到OrderVerify.aspx的Page.Load事件管理程序: / n5 n! }1 Q5 m! C2 _ v+ P* m
subitOrderButton.Attributes.Add(“ServerClick”,”verifyBeforeSubmit();”) - P2 I( Y9 m3 b
</p>50:您正在为一家销售录像带的在线商店创建一个ASP.NET应用程序。根据用户以往的购买情况,每个用户都将被指派一个配置文件。 1 W) B1 E- L! v% h: R
您编写了名为Displayrecommendations的过程,用于调用LoadUserProfile函数并在用户登录时显示推荐影片列表。如果无法找到该用户的配置文件,则LoadUserProfile函数会产生一个FileNotFoundException异常。
& E. \4 p, |0 R/ a7 e9 R3 x当FileNotFoundException异常产生时,您希望产生另一个描述性错误。此错误消息的文本存储在名为descriptionString的变量中。为了调试目的,您还希望可用编程方式访问FileNotFoundException错误。
1 X! X& a# Q: D您需要为此异常编写catch块。您应该使用哪段代码?(D)
4 O' @4 s9 ^ y- ?7 x& yA. Cache ex As ApplicationException - R" [& z/ i0 F0 c1 h
Throw New ApplicationExcetipn(descriptionstring ,ex) ) [6 q+ d3 t& c" Q9 b: n
B. Cache ex As FileNotFoundException - M/ B) N/ o$ f8 _" ^7 j" y, H [4 A
Throw New ApplicationExcetipn(descriptionstring ,ex) $ [ B5 @3 y. y {! O
C. Cache ex As ApplicationException
T+ ^9 Z' z& s+ c( B+ t Throw New ApplicationExcetipn(descriptionstring ,_ex.InnerException) / X* b" J/ s/ j3 _; _4 v+ n
D. Cache ex As FileNotFoundException 8 b7 n% O# W8 l, n1 ?$ T
Throw New ApplicationExcetipn(descriptionstring ,_ex.InnerException) |