Groups | Blog | Home
all groups > dotnet xml > october 2003 >

dotnet xml : xslt and webcontrols


Thomas
10/31/2003 11:12:01 PM
Hello all,
Is it possible to use webcontrols in a xslt file eg.

<xsl:template match="products">
<asp:Button id="Button1" runat="server" Text="test"/>"></asp:Button>
</xsl:template>

/Thomas

Kirk Allen Evans [MVP]
11/4/2003 5:47:01 PM
The only way that you can currently do this is to create a dummy namespace
in the XSLT that the "asp" prefix can be bound to, transform the XML into a
string, then remove the namespace declaration for the dummy namespace. Once
you have a string without the namespace declaration, call Page.ParseControl
for the string, then add the resulting control to another control's
..Controls collection.

For an example, see my web log.[1]

[1] http://weblogs.asp.net/kaevans/posts/2795.aspx


--
Kirk Allen Evans
Microsoft MVP, ASP.NET
XmlInsider
www.xmlandasp.net
Read my web log at http://weblogs.asp.net/kaevans


[quoted text, click to view]

AddThis Social Bookmark Button