By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
426,115 Members | 894 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 426,115 IT Pros & Developers. It's quick & easy.

Populating asp:dropdownlist in XSLT file using extension object

P: n/a
Hi

I am trying to populate a <asp:dropdownlist> in a XSLT file withdatasource pointing to a C# codebehind file method which returnsa dataview. I am using XSLT extension object. But I am getting"The 'DataSource' property is set only by the runtime. It cannotbe declared." error

code:
<?xml version="1.0"?>
<xsl:stylesheet version="1.0"xmlns:xsl="http://www.w3.org/1999/XSL/Transform"xmlns:MyObj="urn:ProductInfo" xmlns:asp="remove">
<xsl:output method="html"></xsl:output>
<xsl:template match="/">

<TR>
<TD class="Input" align="right" width="200" height="21">
<P>Product Type:<SPAN class="reqd">*</SPAN></P>
</TD>
<TD class="Input" height="21">
<P>
<xsl:element name="asp:dropdownlist">
<xsl:attribute name="runat">server</xsl:attribute>
<xsl:attribute name = "id">ddlProdType</xsl:attribute>
<xsl:attribute name ="DataSource">MyObj:GetProdType()</xsl:attribute>
<xsl:attribute name = "DataTextField">TEXT</xsl:attribute>
<xsl:attribute name = "DataValueField">VALUE</xsl:attribute>
</xsl:element>
</P>
</TD>
</TR>
</xsl:template>
</xsl:stylesheet>
..................
Any ideas? Or is there any way i can populate my asp dropdownlist in xsl with dataview/datatable/Dataset returned fromcodebehind methods?
--------------------------------
From: Ganesh Kolappan

-----------------------
Posted by a user from .NET 247 (http://www.dotnet247.com/)

<Id>yU2Iaxdt7ECfHbhXKzUHVw==</Id>
Nov 12 '05 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.