ASP.NET Validation Server Controls

User input validation can be done with ease with the help of ASP.NET Validation Sever Controls. Coding is not required at all because ready-made ASP.NET Validation Server Controls are present for use with just a drag and drop away.

ASP.NET Validation Server Controls are used to validate the input data through a form by a user of the web application.  ASP.NET Validation Server Controls then checks if the input data by the user is validated and displays an error message if the validation fails.

Shown below is a code snipper of  ASP.NET Validation Server Controls.

<asp:control_name id=”some_id” runat=”server” />

ASP.NET Validation Server Controls
ASP.NET Validation Server Controls

  • CompareValidator - takes an input value and then compares it with another input value or a fixed value
  • CustomValidator - used to code your own validation methods to handle the data inputted by the user
  • RangeValidator - checks a value input by a user against a range i.e. whether it is between two values
  • RegularExpressionValidator - makes sure that the input value matches an already specified pattern
  • RequiredFieldValidator - makes an input field a required field
  • ValidationSummary - displays a report i.e. a summary of all validation errors occurred in a Web Page
Posted in ASP.NET 4 Theory | Tagged , , , , , | Leave a comment

ASP.NET Button Control

When developing an ASP.NET Web application using Visual Studio 2010, you can use an ASP.NET Button Control to display a Push button. These ASP.NET Buttons controls can be used as a Submit button or even an Command button.

ASP.NET Button Control do not have command name thus it posts the Web page back to the server when then control is clicked. When using the control an event handler can be coded to control the actions performed when the submit button is clicked.

Note:

  • ASP.NET Button Control is a Submit button by default.
  • ASP.NET Button control as a Command button has a command name which allows you to create multiple Button Controls on a page.
  • By codng an Event Handler, the ASP.NET Button control as a Command button’s actions performanced can be controlled.

Here are a few quick steps on how to add your very own ASP.NET Button Control.

  1. Go to the Toolbox and under the Standard section, select Button Control.

ASP.NET Button Control
ASP.NET Button Control

  1. Drag and drop it onto the Form area to declare it.
  2. The following is the code you get in the Source View.

<asp:Button ID=”Button1″ runat=”server” Text=”Button” />

Posted in ASP.NET Tutorial | Tagged , , , , , , | Leave a comment

ASP.NET BulletedList Control

When using ASP.NET to create web application, you have the ability to use ASP.NET BulletedList Control to create a bulleted list format for an ASP.NET .aspx web page. This control was first introduced in ASP.NET 2.0. When using ASP.NET BulletedList Control every item in the control is defined by a ListItem Element.

Here is a quick tutorial on adding your very own ASP.NET BulletedList Control.

  1. Go to the Toolbox and under the Standard section, select BulletedList Control.

ASP.NET BulletedList Control
ASP.NET BulletedList Control

  1. Drag and drop it onto the Form area to declare it.
  2. The following is the code excerpt you get in the Source View.

<asp:BulletedList ID=”BulletedList1″ runat=”server”>
</asp:BulletedList>

For more on how to use ASP.NET BulletedList Control check out the examples at www.aspnetbook.com

Posted in ASP.NET Tutorial | Tagged , , , , , | Leave a comment

ASP.NET Web Server Controls

When using ASP.NET, the ASP.NET Server interprets special tags known as ASP.NET WebServer Controls. These ASP.NET WebServer Controls like HTML Server Controls are interpreted at the Server end thus a runat=”server” tag is necessary. ASP.NET WebServer Controls also do not map to any current HTML elements and they also may represent more complex elements.

The following is a code snippet on how to Create a Web Server Control in ASP.NET.

<asp:control_name id=”some_id” runat=”server” />

ASP.NET Web Server Controls
ASP.NET Web Server Controls

Posted in ASP.NET 4 Theory | Tagged , , , , , | Leave a comment

ASP.NET AdRotator Control

ASP.NET Adrotator Control displays images in a sequence mode, and this Control can be used for Advertisement elements. ASP.NET AdRotator Control stores the Advertisement’s information in an XML file.

The following code snippet shows how to initiate the XML file.

<Advertisements>
<Ad>
<ImageUrl>/banners/ad1.gif</ImageUrl>
<NavigateUrl>http://www.aspnetbook.com</NavigateUrl>
<AlternateText>Main Site</AlternateText>
<Impressions>10</Impressions>
<Keyword>Keywords Here</Keyword>
</Ad>
</Advertisements>

Within these tags there can be many <Ad></Ad> tags, these are used to define different advertisements

Here is a quick tutorial on how to add your very own ASP.NET Adrotator Control to your .aspx page.

  1. Go to the Toolbox and under the Standard section, select AdRotator Control.

ASP.NET AdRotator Control
ASP.NET AdRotator Control

  1. Drag and drop it onto the Form area to declare it.
  2. The following is the code excerpt you get in the Source View.

<asp:AdRotator ID=”AdRotator1″ runat=”server” />

For more on how to use ASP.NET Adrotator Control check out the examples at www.aspnetbook.com

Posted in ASP.NET Tutorial | Tagged , , , , , | Leave a comment