You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.
You create a Web form by using ASP.NET AJAX.
You write the following client-script code fragment to handle the exceptions thrown from asynchronous
postbacks. (Line numbers are included for reference only.)
01
You need to ensure that the application performs the following tasks:
- Use a common client-script function named errorHandler.
- Update a Label control that has an ID named lblError with the error message.
- Prevent the browser from displaying any message box or Javascript error.
What should you do?
You are creating ASP.NET applications by using the .NET Framework 3.5. The application has two tables named Products and ProductPrice. The application retrieves and stores data from the Product table into a Dataset object. The application uses the DataSet object to modify and update the data that is retrieved. The update command for the related SqlDataAdapter class is generated automatically by using a SqlCommandBuilder object. You plan to retrieve and modify data from the Product and ProductPrice tables as a unit. You need to ensure that the application can update the data in the tables. What should you do?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You add a Web page named HomePage.aspx in the application. The Web page contains different controls. You add a newly created custom control named CachedControl to the Web page. You need to ensure that the following requirements are met: The custom control state remains static for one minute. The custom control settings do not affect the cache settings of other elements in the Web page. What should you do?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5.You write the following code segment to create a client-script function. (Line numbers are included for reference only.)
01 function updateLabelControl(labelId, newText) {
02 var label = $find(labelId);
03 label.innerHTML = newText;
04 }
The client script function uses ASP.NET AJAX and updates the text of any Label control in the Web form. When you test the client script function, you discover that the Label controls are not updated. You receive the following JavaScript error message in the browser: "'null' is null or not an object." You need to resolve the error. What should you do?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a Web page named enterName.aspx. The Web page contains a TextBox control named txtName. The Web page cross posts to a page named displayName.aspx that contains a Label control named lblName. You need to ensure that the lblName Label control displays the text that was entered in the txtName TextBox control. Which code segment should you use?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a Web form that contains the following code fragment. OnClick="btnSearch_Click" /> You write the following code segment in the code-behind file. (Line numbers are included for reference only.)
01 protected void Page_Load(object sender, EventArgs e)
02 {
03 DataSet objDS = new DataSet();
04 SqlDataAdapter objDA = new SqlDataAdapter(objCmd);
05 objDA.Fill(objDS);
06 gridCities.DataSource = objDs;
07 gridCities.DataBind();
08 Session["ds"] = objDS;
09 }
10 protected void btnSearch_Click(object sender, EventArgs e)
11 {
12
13 }
You need to ensure that when the btnSearch Button control is clicked, the records in the gridCities GridView control are filtered by using the value of the txtSearch TextBox. Which code segment you should insert at line 12?
You are maintaining an ASP.NET application by using the .NET Framework 3.5. The application uses Forms authentication. Security testing of the application reveals that users can access the sessions of other users on different computers. You need to configure the application to eliminate the vulnerability. What should you do?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You write the following code fragment. You need to ensure that when you click the Button1 control, a selected list of items move from the ListBox1 control to the ListBox2 control. Which code segment should you use?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You add a Web page named HomePage.aspx in the application. The Web page contains different controls. You add a newly created custom control named CachedControl to the Web page. You need to ensure that the following requirements are met: The custom control state remains static for one minute. The custom control settings do not affect the cache settings of other elements in the Web page. What should you do?
You create a Microsoft ASP.NET application by using the Microsoft .NET Framework version 3.5. You create a Web page named Default.aspx in the root of the application. You add an ImageResources.resx resource file in the App_GlobalResources folder. The ImageResources.resx file contains a localized resource named LogoImageUrl. You need to retrieve the value of LogoImageUrl. Which code segment should you use?