Which of the following actions will he take to accomplish the task?

Posted by: Pdfprep Category: GSSP-.NET Tags: , ,

John works as a Web Developer for TechCom Inc. He creates an ASP.NET application, named MyApp1, by using Visual Studio .NET for a University Web site. Students will use MyApp1 to view their term end results. MyApp1 contains an ASP.NET page, named Page1. Page1 contains a TextBox control, named txtEnrolmentNo, and two Button controls, named btnSubmit and btnCancel.

John wants to display the text "Enter Enrolment Number" within txtEnrolmentNo. He wants to ensure that if a user tries to submit the page without entering an enrolment number, the

word "Error" appears next to txtEnrolmentNo.

Which of the following actions will he take to accomplish the task? Each correct answer represents a part of the solution. Choose two.
A . Add a RequiredFieldValidator control to the page. Set its ControlToValidate property to txtEnrolmentNo, InitialValue property to "Enter Enrolment Number", and ErrorMessage property to "Error".
B . Add a RequiredFieldValidator control to the page. Set its ControlToValidate property to txtEnrolmentNo, ErrorMessage property to "Enter Enrolment Number", and InitialValue property to "Error".
C . Set the InitialValue property of txtEnrolmentNo to "Enter Enrolment number".
D . Set the Text property of txtEnrolmentNo to "Enter Enrolment number".
E . Add a RegularExpressionValidator control to the page. Set its ControlToValidate property to txtEnrolmentNo, ErrorMessage property to "Enter Enrolment Number", and InitialValue property to "Error".

Answer: A,D

Leave a Reply

Your email address will not be published.