Both Page_Init and Page_Load
Neither in Page_Load nor Page_Init
The control’s value set during the postback can be accessed in Page_Load.
You create an ASP.NET page named Customer.aspx. Customer.aspx contains a Web user control that displays a drop-down list box of Cities. The Web user control is named CityList, and it is defined in a file named CityList.ascx. The name of the DropDownList control in City.ascx is CuCity. You try to add code to the Page.Load event handler for Customer.aspx, but you discover that you cannot access CuCity from code in Customer.aspx. You want to ensure that code within Customer.aspx can access properties of CuCity.
What should you do?
In the code-behind file for CityList.ascx, add the following line of code:Protected CuCity As DropDownList
In the code-behind file for Customer.aspx, add the following line of code:Public CuCity As DropDownList
In the code-behind file for Customer.aspx, add the following line of code:Protected CuCity As DropDownList
In the code-behind file for CityList.ascx, add the following line of code:Public CuCity As DropDownList
We need to declare CuCity as public to access it.
Multiple platform support
Code access security
You are creating an ASP.NET application that will record each customer's entry. It is possible that thousands of entries could be posted at any given time. Your application will be hosted on twenty Web servers. As customers enter information into your application, maintaining state information will be important. This information should be stored securely and should be capable of being restored in the event that a Web server is restarted. Customers will enter data into three separate pages in your application.
Which of the following methods of storing state information would best suit the situation?
<%@ Register tagprefix="ril" Tagname="test" Src="rilTest.ascx" %>
Register a new web site
Register a new tag
Register a new user control
Register a new web page
You are debugging an ASP.NET application for Premium Corp.. Users will use the application to produce reports. Your application contains several Debug.WriteLine statements. Which window in Visual Studio .NET should you use to inspect output from the Debug.WriteLine statements?
Useful resources, Debug.WriteLine Method
The Server configuration will always override the Application configuration
The Application configuration will always override the Server configuration
The Server configuration will override the Application configuration if allowOverride is set to "false" in the settings in the Server configuration file
The Application configuration will override the Server configuration if allowOverride is set to "false" in the settings in the Server configuration file
(a)MSIL code is platform independent
(b)CLR is platform dependent
Only (a) is true, (b) is false
Only (b) is true, (a) is false
Both (a) and (b) are true
Both (a) and (b) are false
You are creating an ASP.NET page for your company's Web site. Customers will use the ASP.NET page to enter payment information. You add a DropDownList control named oPaymentTypeList that enables customers to select a type of credit card and bank accounts. You need to ensure that customers select a credit card type. You want a default value of Select to be displayed in the oPaymentTypeList control. You want the page validation to fail if a customer does not select a payment type from the list. What should you do?
Add a RequiredFieldValidator control and set its ControlToValidate property to oPaymentTypeList. Set the InitialValue property of the RequiredFieldValidator control to Select.
Add a RequiredFieldValidator control and set its ControlToValidate property to oPaymentTypeList. Set the DataTextField property of the oPaymentTypeList control to Select.
Add a CustomValidator control and set its ControlToValidate property to oPaymentTypeList. Set the DataTextField property of the oPaymentTypeList control to Select.
Add a RegularExpressionValidator control and set its ControlToValidate property to oPaymentTypeList. Set the ValidateExpression property of the RegularExpressionValidator control to Select.
Useful resources, RequiredFieldValidator
You are creating an ASP.net application to enter timesheet data intuitively. Users will enter data using a DataGrid. You have added a button column to your DataGrid. The button column uses a custom button to allow users to initiate some calculations on the data in the grid. Which event does the DataGrid control raise when the custom button is clicked?
Useful resources, DataGrid.ItemCommand