Print
Add To Favorites
Email To Friend
Rate This Article
|
Building ASP.NET Web Server Controls using XML and XSLT
|
Published:
31 Jul 2008
|
Abstract
In most cases, server controls are very useful in ASP.NET web applications since they have some valuable events (click event, data binding event, data bound event, etc) and other advanced functionality like state management, input validation, etc. In general, XSLT produces plain XML or HTML without any hassle, but if we want to create our ASP.NET server controls by using XML and XSLT then we should follow some procedures which the author has outlined in this article. After providing a brief introduction, he examines the steps involved such as preparing XML document, preparing XSLT document to transform XML data, defining server and validation controls according to XML document, parsing controls, and defining event handlers with the help of relevant code samples along with detailed analysis. |
 |
by Ehsanul Haque
Feedback
|
Average Rating:  
Views (Total / Last 10 Days):
10239/
296
|
|
|
|
| Introduction |
XML has a vast use in web application because of column
flexibility and platform independence ability. Because of column flexibility,
programmers can increase or decrease a column anytime without changing much
code (like different types of address such as home address, office address,
etc). On the other hand, XSLT can traverse XML faster which can operate with
lots of XML data quickly and can give the application a dynamic layout without
touching any single line of code from the code-behind. So the combination of
XML and XSLT can show its own strength and beauty which can boost up our
application.
Requirements
I am assuming that the reader of this article have basic
knowledge in XML, XSLT and ASP.NET.
Background
A few days ago, my boss requested me to work with a huge
amount of employees' data which will become a handy web service in XML Format.
We can easily sort out the problem in the traditional way, but the problem is
he was very concerned with performance. Also, the client asked that the layout
be dynamic. I will describe the most interesting part of our implementation
where we will show and edit a list of employees' address.
Figure 1

|
|
|
|
|
Article Feedback
User Comments
Title:
Great Job
Name:
Xiaohong
Date:
9/17/2008 4:34:23 PM
Comment:
big helps, thank you!
|
Title:
Designer
Name:
Ehsan
Date:
9/17/2008 2:58:10 PM
Comment:
Hi, This is a very good question. Though VS don't have XSLT design view support, change in xslt is very easy rather than changing design of page dynamically in traditional way. In this technique total design and data will be separate from each other. In the xml, we are just keeping the data as well as some valuable information like validation, data type, caption, etc. But the design template is totally separate from the data template to design independently. And Being template based, XSLT is more resilient to changes in documents than low level DOM and SAX. Also By separating data (XML document) from the presentation (XSLT), it is very easy to change the output format in any time easily without touching the code-behind. In case of repeatating design (like employee paystub design), the XSLT template will be extremely small sized by repeatating calling as it works template based. If designer is quite smarter then they can make the design more dynamic than any other way using this simple technique.
Thanks
|
Title:
Designer
Name:
redsquare
Date:
9/17/2008 9:35:05 AM
Comment:
With all that markup and inline styling can I ask how a web designer is supposed to design and edit the content if the developer has bundled it into xml files??
|
Title:
Nice Article
Name:
Kamran Shahid
Date:
9/16/2008 1:46:55 AM
Comment:
Very Nice One Ehsan.
|
Title:
Congratulations
Name:
Ahsanul Haque
Date:
8/3/2008 7:31:28 AM
Comment:
I am proud, infact very proud watching this. Keep it up. congratulations.
|
Title:
awesome
Name:
Mamun
Date:
8/2/2008 10:40:20 AM
Comment:
Great job ehsan vai. Keep up these good works.
|
Title:
good job
Name:
Kamrul Hassan
Date:
7/31/2008 3:01:50 PM
Comment:
i'm familiar with xml data binding in the traditional way. But after reading this article, hopefully I am going to use this technique for the upcoming development in my software career life :D. Well done !!! Great work.
Thanks you for your nice well commented code and obviously the clear explanation.
|
Title:
nice
Name:
shahin mahmud
Date:
7/31/2008 3:00:24 PM
Comment:
Nice job , go ahead
|
Title:
Good One
Name:
Ferdous Hassan
Date:
7/31/2008 2:59:43 PM
Comment:
Hi Ehsanul, I am a software engineer of a company. Recently I am working with a good amount data and I was looking for a XML solution. And this is exactly what I need to start. Thanks for sharing a good idea.
|
Title:
ExCeLlEnTo
Name:
Shahid Khan
Date:
7/31/2008 10:50:00 AM
Comment:
ExCeLlEnTo..... gReAt WoRk buddy !!!
|
Title:
Excellent
Name:
Khabir
Date:
7/31/2008 10:45:31 AM
Comment:
Good job. keep it up.
|
|
Product Spotlight
|
|
|