Exam 70-562 : Microsoft .NET Framework 3.5, ASP.NET Application Development – 35

Question: You are in the process of creating an ASP.NET application using .NET Framework 3.5. The application is designed for mobile devices and contains a mobile Web form. The Web form has the following code:

You then create an event handler named OlCrtl_ItemComman

  • You have to make sure that the event handler will identify the selection of the ShowData item. What should you do?
    1. You should consider writing the following code segment:
      Public Sub OlCrtl_ItemCommand(ByVal sender As Object, _
      ByVal e As ObjectListCommandEventArgs)
      Dim olCmd As ObjectListCommand = TryCast(sender, ObjectListCommand)
      If olCmd.Name = “ShowData” Then
      End If
      End Sub
    2. You should consider writing the following code segment:
      Public Sub OlCrtl_ItemCommand(ByVal sender As Object, _
      ByVal e As ObjectListCommandEventArgs)
      Dim olCmd As ObjectListCommand = TryCast(e.CommandSource, ObjectListCommand)
      If olCmd.Name = “ShowData” Then
      End If
      End Sub
    3. You should consider writing the following code segment:
      Public Sub OlCrtl_ItemCommand(ByVal sender As Object, _
      ByVal e As ObjectListCommandEventArgs)
      If e.CommandName = “ShowData” Then
      End If
      End Sub
    4. You should consider writing the following code segment:
      Public Sub OlCrtl_ItemCommand(ByVal sender As Object, _
      ByVal e As ObjectListCommandEventArgs)
      If e.CommandArgument.ToString() = “ShowData” Then
      End If
      End Sub

    Correct Answer: 3


    Question: You are the senior technician at Company.com. You have been instructed to create an ASP.NET AJAX enabled application that uses Microsoft .NET Framework 3.5. Your application contains a Web form. In order to handle exception from asynchronous postbacks you decide to write the client script code fragment below. (The line numbers is included for reference purposes)
    01 <script type=”text/javascript”>
    02 function pageLoad()
    03 {
    04 var getErr = Sys.WebForms.PageRequestManager.getInstance();
    05
    06 }
    07
    08 function errHandle(sender, args)
    09 {
    10
    11 }
    12 </script>
    You receive an instruction from the senior developer to ensure that the application makes use of the errHandle function to display an error message in a Label control named lbl1 instead of in message box or Javascript error. How can this be accomplished?

    1. This can be accomplished by adding the getErr.add_pageLoaded(errHandle) code segment at line 05. Then the code segment below should be added at line 10.
      if (args.get_err() != null) {
      $get(‘lbl1’).innerHTML = args.get_err().message;
      args.set_errHandle(true);
      }
    2. This can be accomplished by adding the getErr.add_endRequest(errHandle) code segment at line 05. Then the code segment below should be added at line 10.
      if (args.get_err() != null) {
      $get(‘lbl1’).innerHTML = args.get_err().message;
      }
    3. This can be accomplished by adding the getErr.add_pageLoaded(errHandle) code segment at line 05. Then the code segment below should be added at line 10.
      if (args.get_err() != null) {
      $get(‘lbl1’).innerHTML = args.get_err().message;
      }
    4. This can be accomplished by adding the getErr.add_endRequest(errHandle) code segment at line 05. Then the code segment below should be added at line 10.
      if (args.get_err() != null) {
      $get(‘lbl1’).innerHTML = args.get_err().message;
      args.set_errHandle(true);
      }

    Correct Answer: 4


    Question: You work as a Web Developer at Company.com. You make use of Microsoft ASP.NET 3.5 in order to create a Web application. The application contains a generic handler file named CKHandler.ashx. The code below is added to the generic handler file (The line numbers are included for reference purposes):
    01 public class CKHandler : IHttpHandler
    02 {
    03 public void ProcessRequest(HttpContext context)
    04 {
    05 Bitmap validationBitmap = (Bitmap)Session[“ValidationImage”];
    06
    07 }
    08 public bool IsReusable
    09 {
    10 get
    11 {
    12 return false;
    13 }
    14 }
    15 }
    Management wants you to render the validationBitmap instance as a JPEG image as soon as the CKHandler.ashx is requeste

  • You need to determine the code segment that should be added in line 06?
    1. You should add the code segment:
      context.Response.ContentType = “image/jpeg”;
      context.Response.Write(validationBitmap);
    2. You should add the code segment:
      context.Response.ContentType = “image/jpeg”;
      validationBitmap.Save(context.Request.InputStream, ImageFormat.Jpeg);
    3. You should add the code segment:
      context.Response.ContentType = “image/jpeg”;
      context.Response.Write(validationBitmap.RawFormat);
    4. You should add the code segment:
      context.Response.ContentType = “image/jpeg”;
      validationBitmap.Save(context.Response.OutputStream, ImageFormat.Jpeg);

    Correct Answer: 4

  • Tagged . Bookmark the permalink.

    Leave a Reply

    Your email address will not be published. Required fields are marked *

    This site uses Akismet to reduce spam. Learn how your comment data is processed.