This site has been taken over by the staff of www.ASPDeveloper.Net

Please report errors to suggest@aspdeveloper.net

BizTalk Utilities CV ,   Jobs ,   Code library  
 
Home Page
.NET and XML
Code to create entire file system as XML File in VB.NET
Class object for Base64 conversion with .NET
XML Web Services and ASP.NET
String Handling Application using ASP.NET
XML Serialization and .Net
Dynamic Method Invocation in .NET using Reflection API
Using XML classes in .Net
Pass node sets to XSLT stylesheets using .NET
Output a directory as XML using .NET
.Net, COM Interoperability and Word Object Model
WS-Routing for .NET endpoints
Using XML and XSLT in VB.NET Jeopardy
Symmetric Encryption/Decryption with .NET
XInclude.NET 1.0
EXSLT.NET 1.0
How to read a XML file using XmlTextReader?
How to compare a XML element with XmlTextReader?
How to verify if an element is empty with XmlTextReader and IsEmptyElement?
How to check if the XML elements contains any attributes with XmlTextReader
How to avoid to read the XML declaration with XmlTextReader?
<< XSLT
 

By :Mark Wilson
I am the creator of TopXML. I am available for international and local (Australia) contracts. I am a Solution Architect/Business Analyst. I have worked in IT in several countries (NZ, Australia, South Africa, UK) building and training teams for government and very large non-governmental organizations. I am ex-Microsoft Consulting Services. I wrote the first book on Microsoft XML published in 2000 called XML Programming with VB and ASP. Most recently I have been building tools for the SEO industry. Ask me for a 37 point SEO health-checkup for your website.
First posted :03/24/2008
Times viewed :6900

 

ASP.NET XML Architecture

ASP.NET is quite a step forward from the original ASP. The ASP programming model is completely revamped to fit with the rest of the .NET architecture. ASP.NET presents a fully object-oriented architecture that promotes the development of well-structured, easy to maintain code and has full access to every .NET class. Just like classic ASP, ASP.NET pages are (primarily) templates for HTML pages with the file extension .aspx. The ASP.NET engine processes the templates in response to an HTTP request and replaces certain pieces before it is sent to the requester, which is typically a web browser. In ASP.NET the replaced pieces are either render blocks – the sections enclosed by <% ... %> containing program code – or special tags that map to classes in .NET assemblies.


 

Figure 17.1: ASP.NET creates dynamic content from render blocks and custom tags.

In contrast to classic ASP, none of the code in an ASP.NET page is interpreted; it is compiled into an assembly just like any other .NET library the first time it is requested. Compiling the code renders two additional advantages over the interpreted model. First, the compilers check code syntax, method parameters and return values therefore you get more precise error messages you’re your code contains a bug; it is no longer just the cryptic “ASP Error”. Second, ASP.NET pages execute faster than classic ASP pages (after the initial compilation) because compiled code is more efficient than script that is interpreted for every request.

In addition render blocks and the <script runat=”server”> tags many of us already know from programming regular ASP pages ASP.NET offers a third, new option where we can place code. It is a special code file that is called a “code-behind file”. This file can contain the definition for the base class of the actual page. The derived class – the page – can access methods and properties from that base class which makes the code-behind file a good place for the methods we call from the page template. That keeps the clutter out of the HTML templates, but more importantly, the code-behind page is built into a regular .NET assembly as part of the regular build process of a web application. It is compiled before you deploy a web application to let the compiler, not the QA department or the user, detect coding errors in your pages.

Building Pages with Re-usable Controls

The new object-oriented ASP.NET architecture borrows many concepts from the forms-based user interface model pioneered by Visual Basic. Each ASP.NET page behaves like a form with a number of interface elements like text boxes, drop down lists and check boxes. These interface components are called web controls or server-side controls. We can mix and match the server-side control to build very complex, interactive pages. Using Visual Studio.NET, or Microsoft’s free ASP.NET development tool Web Matrix, you can even design web pages just by dragging and dropping controls onto a forms designer instead of writing HTML code.

Still, ASP.NET web controls are still nothing but HTML and JavaScript to enable all sorts of client-side behavior when they reach the client browser. On the server-side, in the ASP.NET pages, the web controls look like HTML, which the web forms designer can create for us. Take the form from this screenshot.


 

Figure 17.2: Graphical Web Forms Designers allow WYSIWYG design of ASP.NET pages.

     

The ASP.NET code for the page looks somewhat like this:

<html>

<body>

    <form runat="server">

        <asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 152px;
          POSITION: absolute; TOP: 136px"
          runat="server" Text="Click Me">

        </asp:Button>

    </form>

</body>

</html>

The HTML literate among us will immediately notice that the <asp:Button> tag is not valid HTML. There is also the runat=”server” attribute that is not defined by the W3C HTML standard, but is it this attribute what signals to the ASP.NET engine that this tag represents a server-side control that needs further processing before sending the page to the browser. When ASP.NET finds this tag while processing an ASP.NET page it instantiates a special Button object to handle render the button as HTML. The object in charge of rendering an <asp:Button> tag, for example, produces the HTML to render a button on a web page:


Rate this article on a scale of 1 to 10

Your vote :  


 

Recent Jobs

Software Specialist, Linux - Finlan
Linux Core Technical Project Manage
Graphics designer at Tanzania. Expe
Integration Specialist Needed - Wor
Virtualization Server Infrastructur

View all Jobs (Add yours)
View all CV (Add yours)






    Email TopXML  

Front Page Daily Stuff TopXML Forum XML blogs XML Newsgroups BizTalk Biztalk Utilities Biztalk Utilities Tutorial B2B SAP XML Microsoft .NET Dotnet System XML Soapformatter SQLXML XMLserializer XQuery PHP PHP SimpleXML PHP XML Dom PHP XML RPC PHP XSLT Java Java Java XML Xalan Microsoft ASP ASP Schemas XML SQL Server XML XMLDom XSL XSL Tutorial XSLT Stylesheets General Javascript CSS XHTML WAP