2012年微软认证考试考前冲刺试题9
09-08
0


 

QUESTION 17
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You plan to add a custom parameter in the SqlDataSource control.
You write the following code fragment.
 
 
 
 
 
 
You write the following code segment to create a custom parameter class.
public class DayParameter : Parameter { }
You need to ensure that the custom parameter returns the current date and time.
Which code segment should you add to the DayParameter class?
 
A.protected DayParameter() : base("Value", TypeCode.DateTime, DateTime.Now.ToString()) {
}
B.protected override void LoadViewState(object savedState) {
((StateBag)savedState).Add("Value", DateTime.Now); }
C.protected override object Evaluate(HttpContext context, Control control) { return DateTime.Now; }
D.protected override Parameter Clone() {
Parameter pm = new DayParameter(); pm.DefaultValue = DateTime.Now; return pm; }

Answer: C

QUESTION 18
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. The application has an ASPX page named ErrorPage.aspx.
You plan to manage the unhandled application exceptions.
You need to perform the following tasks:
Display the ErrorPage.aspx page  Write the exceptioninformation in the Event log file.
Which two actions should you perform? (Each correct answer presents part of the solution.
Choose two.)
 
A.Add the following code fragment to the Web.config file.

B.Add the following code fragment to the Web.config file.

C.Add the following code segment to the Global.asax file.
void Application_Error(object sender, EventArgs e) 
{
    Exception exc = Server.GetLastError(); 
    //Write Exception details to event log 
}
D.Add the following code segment to the ErrorPage.aspx file.
void Page_Error(object sender, EventArgs e) 
{
   Exception exc = Server.GetLastError(); 
   //Write Exception details to event log 
   Server.ClearError(); 

 

相关内容

热门资讯

2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试必备经典试题8
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试必备经典试题6
微软认证考试基于.NET的We... 微软认证考试基于.NET的Web应用程序开发模拟试题四
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试必备经典试题4
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试必备经典试题5
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试必备经典试题10
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试经典试题2
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试经典试题7
2012年微软认证考试备考模拟... 2012年微软认证考试备考模拟试题5
2014年微软认证:微软认证V... 2014年微软认证:微软认证Version:V2.38考试经典试题1