ExpertRating - Online Certification and Employment Testing ExpertRating - Online Certification and Employment Testing ExpertRating - Online Certification and Employment Testing

ExpertRating Home
ExpertRating Benefits
Recommend ExpertRating
Suggest More Tests
Privacy Policy
ASP Dot Net Tutorial - Index
ASP Dot Net Tutorial - Microsofts ASP.NET
ASP Dot Net Tutorial - Begining Web Forms
ASP Dot Net Tutorial - User Controls
ASP Dot Net Tutorial - ADO .NET
ASP Dot Net Tutorial - DataBinding to WebControls
ASP Dot Net Tutorial - DataList Controls
ASP Dot Net Tutorial - DataGrid Control
ASP Dot Net Tutorial - Advance Practical Examples on DataGrid
ASP Dot Net Tutorial - Working with DataSets
ASP Dot Net Tutorial - Working with XML
ASP Dot Net Tutorial - Forms Based Authentication
ASP Dot Net Tutorial - Windows Based Authentication

Online Personal Trainer Certification
Personal Trainer Certification (Spanish)
Six Sigma Certification
Find a Personal Trainer
Project Management Certification
Six Sigma Certification
Six Sigma Black Belt Certification
Master Black Belt Certification
Six Sigma Green Belt Certification
Life Coach Certification
Lean Management Certification
Lean Six Sigma Certification
First Aid Certification
CPR Certification
Yoga Certification
Aerobics Certification
Pilates Certification
Business Analyst Certification
SEO Certification
Online Business Writing Course & Certification
Makeup Artist Certification
Baby Sitting Course & Certification
Time Management Certification
Health Club Management Certification
Medical Coding Certification
Medical Billing Certification
Business Analysis Course
Master Trainer Certification
Total Quality Management Certification
Kaizen Certification
Creative Writing Certification
Event Management Certification
Test Search by Job Title
Administrative Assistant Certification
Virtual Assistant Certification
  All Online Courses


  Home > Courses, Tutorials & eBooks > ASP.NET Tutorial > User Controls

ASP.NET Tutorial - User Controls

                                                                                                                 Page 2 of 5

The output of this example is shown below:

The above example has few interesting features. Firstly note the @ Register directive in line 1 where a prefix to EXPERT and your control name to Logonform is set as shown below: -

1: <%@ Register tagprefix="EXPERT"Tagname="Logonform" Src="Logonform.ascx" %>

This control can be used as a reference somewhere else with the code, as shown in line 5 as shown below: -

5: <EXPERT: Logonform id="Logon" runat="server"/>

Further call_ascx.aspx page to the Logonform.ascx page and display the functions of user control as shown in the output snapshot above.

Validating ASP.NET Pages

Traditionally, Web developers face a tough choice when form validation logic is added to their pages. Addition of form validation routines can be done either on the server side code, or on the client side code. The advantage of writing validation logic at client side code is that it provides instant feedback to the users. For example, if a user ignores to enter a value in a required form field, an instant error message can be displayed without requiring a roundtrip back to the server. Client side validation is more useful and it creates a better overall user experience.

Configuring Client-Side Validation

The validation controls make use of a JavaScript script library, which is automatically installed on the server when .NET framework is installed. This library is located in file name WebUIValidation.js. By default WebUIValidation.js is installed in a directory named aspnet_client located beneath the Web server’s wwwroot directory.

If the location of the root directory is changed, it is important to copy the aspnet_client directory to the new directory, otherwise the validation script will not work and a warning error will be received as shown below.




Home  |  About Us  |  Privacy Policy  |  Site Map  |  FAQs  |  Contact Us
© ExpertRating 2015. All Rights Reserved.