<asp:xml> question

D

Danny Ni

Hi,

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"
DocumentSource="data.xml"></asp:Xml>

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">
<tr>
<td>
Address: <input type="text" id="txtAddress" name="txtAddress"
class="underline" onchange="update1();">
</td>
</tr>
<tr>
<td>
Name: <input type="text" id="txtName" name="txtName" class="noborder"
onchange="update1();">
</td>
</tr>
</table>
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
 
J

Jeffrey Palermo [MCP]

Danny,
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
Request.Form["txtName"].

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

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,813
Latest member
lawrwtwinkle111

Latest Threads

Top