|
|
 |
 |
 |
|
Join the Discussion
|
"Post your views and comments to this chapter of the free Asp.Net Delphi Programming Course"
Discuss!
|
|
 |
 |
|
|
 |
 |
 |
|
|
 |
Welcome to the eighth chapter of the FREE online programming course:
A Beginner's Guide to Asp.Net Programming for Delphi developers.
Taking a look at the use of standard HTML tags and elements and the use of server-side HTML controls - from a perspective of a Delphi developer.
As mentioned earlier in this course, ASP.Net provides two sets of controls you can choose from when developing web applications with web forms.
Besides working with server-side controls (HTML or WEB) every asp.net page will generally contain pure (or native) HTML elements like tables, lists, images, etc. This article provides an overview of working with HTML elements in a server-side fashion. That being said, if your experience with HTML is a little rusty, I do suggest you to take a look at the About HTML web site.
"Pure" HTML - tags, elements, attributes,...
HTML elements are structural parts of a Web Form, defined by HTML tags and tag attributes. By default, classic HTML elements within an ASP.NET web form are treated as literal text and are programmatically inaccessible to page developers - such elements are client-side operated - the client's browser uses the tags to render the page.
For example, This is a link is a hyperlink element; <a> is a tag, href="..." is an attribute.
Another example: <input type=button> - will render a button element on a web form.
In order to programmatically operate on a HTML element from your page's code-behind class, you'll need to server-side "enable" an element you want to operate on. HTML elements that are marked "server-side" are called HTML Controls. HTML controls mimic the actual HTML elements you would use if you were using Notepad, HTMLKit, FrontPage or any other HTML editor to draw your UI.
HTML Controls
To make HTML elements programmatically accessible, you can indicate that an HTML element should be parsed and treated as a server control by adding a runat="server" attribute. Another attribute, "id", allows you to programmatically reference the control - by accessing attributes as properties.
ASP.NET web forms always begin with a HTML control - the HTMLForm control. The HTMLForm control is just like its standard HTML equivalent, but it contains the runat="server" attribute. For other server controls (HTML or web) to be recognized by the ASP.NET framework, they must be placed between beginning and ending
|