runat="server" is not working when transforming xml and xslt

tia_kamakshi
tia_kamakshi used Ask the Experts™
on
Hi,

I am working on ASP.net2.0 using c#

I am rendering  my form using xml and xslt as follows in aspx page

<asp:Xml runat="server" ID="tblTenderDetail" DocumentSource="~/system/xml/ProcurementDocument_Summary.xml" TransformSource="~/system/xml/tenderDetail.xsl" ></asp:Xml>

The output of xml and xslt also creates form on aspx page and displays good on the browser.

As said the transformation of xml, xslt creates form on the aspx page

In xslt I am creating input text field as below

<input type="text" id="txtCompanyName" name="txtCompanyName" runat="server" class="formText" />

as a result, aspx is not rendering this text field as runat="server" and therefore I am not able to read the html textfield in code behind.

I can see textfield on the browser but i am not able to read its values

Is there anyway to force xml and xslt output to runat server or how we can read these values

Please suggest

Thanks & Regards
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
The short answer is: No...
This is because the "runat" attributes are processed by the ASP engine BEFORE the XSL transformation occurs. After the transformation the result is sent directly to the end user's browser without any farther processing. The only way you can create the form at run-time is by code in page load event something like this (pseudo-code):

foreach (XmlNode inputNode in theFormXmlNodeFromXmlDocument)
{
TextBox text = new TextBox();
text.Text = inputNode .InnerText;
theForm.Controls.Add(text )......
}

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial