473,503 Members | 1,715 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

preprocessing ASP.NET tags generated by the XML Control

Hi, I have an ASP.NET webpage that contains an ASP.NET XML control.
This control accepts an XSLT stylesheet and XML document which it then
uses to render HTML code where the XML control is positioned for the
client at the server.

This setup works great for an XSLT stylesheet that generates plain HTML
tags. But, this doesn't work so well if I use ASP.NET tags (such as
<asp:dropdownlist>) inside the stylesheet. Although the code for the
ASP.NET tags DOES get generated by the XML control, it doesn't get
processed by the ASP.NET engine which converts such tags into regular
HTML tags.

As a result, if you view the resulting code on a browser, you will see
that all the <asp:xxxxtags generated by the stylesheet have been sent
to the browser as is.

Is there anyway to force the output of an XSLT transformation to be
pre-processed by ASP.NET before the page is returned to the browser?

Andy

Nov 1 '06 #1
2 2252
Andy wrote:
Hi, I have an ASP.NET webpage that contains an ASP.NET XML control.
This control accepts an XSLT stylesheet and XML document which it then
uses to render HTML code where the XML control is positioned for the
client at the server.

This setup works great for an XSLT stylesheet that generates plain HTML
tags. But, this doesn't work so well if I use ASP.NET tags (such as
<asp:dropdownlist>) inside the stylesheet. Although the code for the
ASP.NET tags DOES get generated by the XML control, it doesn't get
processed by the ASP.NET engine which converts such tags into regular
HTML tags.

As a result, if you view the resulting code on a browser, you will see
that all the <asp:xxxxtags generated by the stylesheet have been sent
to the browser as is.

Is there anyway to force the output of an XSLT transformation to be
pre-processed by ASP.NET before the page is returned to the browser?
You can't use XML control here. You have to transform XML into HTML in
code using XslCompiledTransform class and then make your page to parse
generated HTML to process server controls. See a sample at
http://www.devx.com/tips/Tip/27128

--
Oleg Tkachenko [XML MVP, MCPD]
http://blog.tkachenko.com | http://www.XmlLab.Net | http://www.XLinq.Net
Nov 2 '06 #2

Thanks Oleg, that's what I was looking for!

For others reading this post, what Oleg referred to is:

The XML Control automatically renders the HTML from the XSL
transformation into your webpage without parsing the resulting HTML
code for ASP.NET controls.

You could parse the resulting HTML code yourself and insert the parsed
code into a placeholder on your ASP.NET page instead:

where aspPlaceHolder is an ASP.NET place holder on your page, and
aspHTML is the outputed ASP.NET HTML code segment from an XSL
transformation,

aspPlaceHolder.Controls.Clear()
aspPlaceHolder.Controls.Add(Page.ParseControl(aspH TML))

Nov 2 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
1033
by: No One | last post by:
I have a few ASP.Net tag generated controls that need to have client run Javascript assigned to the click method. When I try to assign a Javascript function call to the OnClick property of the...
2
6631
by: Nathan Sokalski | last post by:
I want to create TD tags with the nowrap property. I have a user control which sets the Wrap property of a TableCell to False when dynamically creating a table as follows: cellCurrButton.Wrap =...
3
1230
by: Rob Nicholson | last post by:
This is a question about the following KB article: http://support.microsoft.com/kb/q262161 We've got a problem with the Infragistics NetAdvantage presentation controls which they've suggested...
1
1544
by: Randall Parker | last post by:
I'm wondering if there are general rules for the use of HTML attributes with ASP tags? For example, one can set an id for an asp:DataGrid and it will show up as the id for the resulting HTML...
5
5500
by: cody | last post by:
the following leads to an error (note that TEST is not defined): #if TEST string s = @" #"; // <-- the error is "preprocessing directive expected" #endif also, here we get the same error: ...
12
8196
by: Thomas Carter | last post by:
Imagine that there is some include file f.h that contains the following line: typedef unsigned int ui32 ; My question is: If I have a C source file F.c that includes f.h, is it possible for...
1
1043
by: Nathan Sokalski | last post by:
I want to add a client-side onchange event to the input tag generated by a CheckBox Control. However, because the CheckBox generates the following set of tags: ...
5
6275
by: Francois Grieu | last post by:
One of the C compiler that I use <OT>(Keil's CX51)</OTbarks at #define a(b) b int main(void){return a( #if 0 #endif 0);} More generally, this compiler seems confused by any preprocessing...
7
1419
by: colin | last post by:
Hi, Is there a way of doing simple code generation inside visual c# express such as similar to preprocessing in c++ ? I need to generate a library for some vector maths, but I need to...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7087
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7281
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7334
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6993
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
1
5014
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4675
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1514
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
383
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.