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

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

<?xml version="1.0"?>
<xsl:stylesheet version="1.0"xmlns:xsl=""xmlns:MyObj="urn:ProductInfo" xmlns:asp="remove">
<xsl:output method="html"></xsl:output>
<xsl:template match="/">

<TD class="Input" align="right" width="200" height="21">
<P>Product Type:<SPAN class="reqd">*</SPAN></P>
<TD class="Input" height="21">
<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>
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 (

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.