drive traffic to your site using hits2u.com

Posts Tagged ‘asp.net’

Using Web Server Controls In Microsoft ASP.NET

When adding interactivity to when pages, ASP.NET developers have two types of server control at their disposal: HTML server controls and Web server controls. HTML server controls are simply regular web elements into which the runat=”server” attribute has been added and which have been assigned an ID. The runat=”server” attribute tells the ASP.NET engine that the control can respond to events and enables developers to create event handlers to control the behaviour of the controls.

Web server controls are more powerful than HTML controls because they are not linked to a specific HTML element and subject to its limitations. Some Web server controls are fairly simple but some of them are extremely complex. They offer black box functionality which would require fairly complex client-side and server-side coding to achieve if they did not exist. It is hardly surprising that server controls are the most frequently used component in ASP.NET.

The great thing about Web server controls is that they allow the developer to focus on the web page functionality and user-response that he or she requires without having to worry about how this would be achieved using HTML elements. At runtime, the ASP.NET engine will generate the necessary HTML, CSS and JavaScript for each client browser.

The calendar control is one example of the advanced functionality offered by the ASP.NET Web server controls. The developer adds this to a web page as a single component and writes code to determine how it will respond to user interaction. At runtime, the necessary HTML markup is produced, saving the developer hours of coding and testing.

Another example of a sophisticated, time-saving Web server control is the FileUpload control. This allows you to add a browse and upload facility to any web page with very little coding. Similarly, the MultiView and View server controls are used in conjunction to control the visibility of different parts of a page. Each view contains different content and the end user is able to move through the views in the sequence specified by the developer.

The Wizard control also offers a way of adding complex interactivity to a web page. Wizards are a very familiar feature in software programs and ASP.NET offers a Web server control that allows you to add this same functionality to a web page. The Wizard server control enables you to set up a series of steps which will be presented to your user in the order you specify. It is ideal for building forms where information is gathered in a series of steps rather than overwhelming the user with one single, huge form. The Wizard control is similar to the MultiView and View controls but offers a far greater degree of customization.

Need to learn Microsoft ASP.NET? We offer Microsoft ASP.NET training in London and all over the UK.

Check out useful things to know in the sphere of one way links – read this site. The time has come when proper information is truly only one click away, use this chance.

Be the first to comment - What do you think?

Posted by freetraff    Date: Monday, February 1, 2010

Categories: website design

Tags:

Using Validation Server Controls In The ASP.NET Web Development Environment

Microsoft ASP.NET includes a number of useful server controls which can be used by developers to quickly add sophisticated functionality to a web form. The validation controls found in ASP.NET are used to check the information entered by visitors to your site into form fields and display error messages if there are problems with the entries. This process is referred to as validation and is an essential part of the information gathering process. Validation requires that you lay down some ground rules for each of the key fields in your form. How strict these rules are how strictly you enforce them is up to you. You will probably want to strike a balance between rules which are not so lax that they allow users to submit rubbish via your form and not so strict that they put users off.

Not all controls found in forms require the same type and degree of validation. For example, text boxes in which the user can choose to enter any information they like is likely to require more checking than a check box which can be checked or unchecked and nothing else. In addition, some fields will require multiple validation checks while others will require only one or perhaps none at all.

The Microsoft ASP.NET validation server controls provide web developers with both server-side and client-side validation. Server-side validation takes place on the server and is usually implemented using one of the two main languages used in ASP.NET web development: VB.Net or C#. Client-side validation takes place in the user’s browser and is usually done using JavaScript, before the form is sent to the server.

There are benefits and drawbacks to both client-side and server-side validation. From the user’s point of view, client-side validation is quicker and also frees up the server to perform other tasks. However, it is in no way secure. It is easy for the user to look at the source code of the page and see what type of validation is being performed. It is also possible for the user to disable the execution of JavaScript within their browser’s preferences.

The downside to server-side validation is that it is slightly slower and uses more of the server’s precious processing power. However, it is secure and allows developers to set up validation procedures which users cannot side-step.

So which one should developers implement? Well, since both client-side and server-side have definite benefits, it is usually best to implement both of them when creating forms. The validation server controls found in ASP.NET make this very doable and very easy.

Does your team need to start Building websites with ASP.NET? Macresource Computer Training offer ASP.NET on-site training in London and all over the UK.

Be the first to comment - What do you think?

Posted by freetraff    Date: Saturday, December 12, 2009

Categories: website building

Tags: , , , ,

Using DataBound Controls In ASP.NET

Microsoft ASP.NET is the premier development environment for creating dynamic server-side content a key element of which is the display of information from data sources. Database-driven web pages are a very common phenomenon. In ASP.NET version 1, the main control for achieving this was the DataGrid. In the current release of ASP.NET, version 3.5, the DataGrid is conspicuously absent from the Toolbox in Visual Web Developer. In fact, although the DataGrid can still be used in ASP.NET pages and will work fine, it is now deprecated. The good news is that there is a good choice of more powerful new controls which have taken its place. Four of these controls (GridView, DataList, Repeater and List View) are suitable for displaying multiple records from a data source and then there are another two (FormView and DetailsView) which are used to display only one record at a time.

Perhaps the most widely-used of ASP.NET’s DataBound controls is the GridView. It displays data items in an automatically-generated table and has a rich set of easily-configurable options. Options include the ability to customize columns and to include custom content in columns such as images or any other relevant HTML column. Command columns can also be added containing links which will enable the user to edit and delete records. The control also supports paging and sorting.

The DataList control also automatically generates a table when it produces its output. However, unlike the GridView control, it allows the display of more than one record per row using its RepeatColumns property. The DataList is also template-driven, requiring the use of an ItemTemplate containing dynamic data. The elements placed inside the ItemTemplate are rendered once for each item in the bound data.

The Repeater Control also relies on ItemTemplate elements for formatting its output. However, since it does not automatically create an HTML table, the Repeater offers considerable flexibility of layout. Output can be rendered as paragraphs, as a series of DIV elements, an ordered list, an unordered list or a customized table.

ASP.NET 3.5 introduced us to the ListView control, which also uses templates for displaying its output. However, it is far more sophisticated, allowing the use of a variety of templates, for example: a LayoutTemplate for specifying the overall container for the data; an ItemTemplate for specifying the rendering of each item of data; an ItemSeparator template, used to specify the content displayed between items of data; and so on. The ListView control also supports paging, sorting and editing records as well as the creation of new records.

Of the two controls used to display single items of data, the DetailsView resembles GridView in that it displays its output in an automatically-generated HTML table. The other single record data bound control, the FormView, resembles the ListView control, in that it is entirely template driven. Both of the single record controls support paging and sorting and allow you to edit and delete records as well as adding new ones.

Need to master Building websites with ASP.NET. We offer ASP.NET on-site classes in London and all over the UK.

Be the first to comment - What do you think?

Posted by freetraff    Date: Friday, November 27, 2009

Categories: website building

Tags: , , , ,