Page 86 - DCAP312_WEB_TECHNOLOGIES_II
P. 86

Web Technologies-II



                   Notes
                                     {
                                       return false;
                                     }

                                   }
                                   You can see, it has just returned false in the LoadPostData method. Now it has used my
                                   CustomTextBox at my aspx page as

                                   %@  Register  TagPrefix="myControl"Namespace="CustomControl"  Assembly="CustomControl"  %>
                                   <asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
                                       <myControl:CustomTextBox ID="TextBox1" runat="Server" ValidateRequestMode="Enabled">
                                      </myControl:CustomTextBox><br /?
                                       <asp:Button ID="Button1" runat="server" Text="Submit" OnClick="Button1_Click" />
                                   </asp:Content>
                                   Now set the requestValidationMode as 4.5 in web.config and enter some script tag and submit.
                                   You would not get any error even RequestValidation is enabled. This proves the validation
                                   fires only when data is accessed from the form collection.
                                   Questions
                                    1.  Explain the page life cycle of a Web page.

                                    2.  What is the use of requestValidationMode?
                                 Self Assessment Questions
                                    6.   ..................... are group of controls derived directly from the System.Web.UI.Web Controls
                                      base class.
                                       (  a)  HTML Server Controls     (b)  Web Server Controls

                                       (  c)  Client Server Controls   (d)  Both a and b
                                    7.  ................... are testing to determine whether the user entered something into the field.
                                       (  a)  Required Field Validator   (b)  CompareValidator control

                                       (  c)  Validation               (d)  Both b and c
                                    8.  The ........................ compares the value of one control to another, or to an explicit value in
                                      the control’s Value to compare property.
                                       (  a)  Required Field Validator   (b)  CompareValidator control
                                       (  c)  Validation               (d)  Both a and c

                                    9.  The ........................ server control makes sure that the user enters something into the field
                                      that it is associated with in the form.
                                       (  a)  Required Field Validator   (b)  CompareValidator control

                                       (  c)  Validation               (d)  Both a and b
                                   10.  ...........................is  the  main  mark-up  language  for  displaying  web  pages  and  other
                                      information that can be displayed in a web browser.
                                       (  a)  XML                      (b)  HTML
                                       (  c)  JavaScript               (d)  None of these.





        80                                LOVELY PROFESSIONAL UNIVERSITY
   81   82   83   84   85   86   87   88   89   90   91