Page 84 - DCAP312_WEB_TECHNOLOGIES_II
P. 84

Web Technologies-II



                   Notes
                                                Figure 4.7: Validation errors showed using the validation
                                                              summary server control





































                                 By default, the Validation Summary server control shows the errors in a bulleted list on the
                                 page using red text. We have the option to completely alter how output displays in the browser.
                                 To change how the error messages are displayed, we can change the value of the Display Mode
                                 property of the Validation Summary control.
                                 The possible values of this control can be set to the following:
                                    •  Bullet List

                                    •  List
                                    •  Single Paragraph
                                 If  we  use  the  Bullet  List  value  for  the  Display  Mode  property,  it  appears  as  shown  in
                                 (Figure 4.7). If we use List, it appears without bullets. If we use Single Paragraph, the errors
                                 appear in a text area all on one line in a single paragraph.
                                 Showing a Dialog Box Containing Error Notifications
                                 One flexible feature of the Validation Summary server control is that we can easily show the
                                 ASP.NET page’s errors in a pop-up dialog box. We have the option of showing the summary
                                 in the browser and the dialog box together, or just in the dialog box.

                                 The property that controls whether the message appears in the browser is the Show Summary
                                 property. To turn off the display of validation errors in the browser, set the value of the Show
                                 Summary property to False. To show validation errors in a dialog box, set the Validation Summary
                                 control’s Show Message Box property to true.






        78                                LOVELY PROFESSIONAL UNIVERSITY
   79   80   81   82   83   84   85   86   87   88   89