<asp:xml> question


Danny Ni


I use the <asp:xml> control, xml and xslt to generate a HTML for users to
input data, here is my HTML snippet in a web form:
<asp:Xml id="Xml1" runat="server" TransformSource="entry.xsl"

The form display correctly in the browser, the question is, how do I get the
values users input?

To clarify a little bit, with data.xml and entry.xsl, Xml1 generated HTML
form like this:
<table border="0">
Address: <input type="text" id="txtAddress" name="txtAddress"
class="underline" onchange="update1();">
Name: <input type="text" id="txtName" name="txtName" class="noborder"
The users can input something into address and name fields. In the web form
code behind file, I would like to get values user inputted.

Thanks in Advance



Jeffrey Palermo [MCP]

In order to get the values in your server code, the input fields need to
be server controls. Just transforming xml to emit html <input> elements
doesn't make them server controls, and your server code will have no
visibility to their values.

I don't know the details of your situation, but if the page posts back
to itself, these <input> elements will still send data to the server, so you
could get these values by using Request.Form["txtAddress"] and

Best regards,
Jeffrey Palermo

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question