<asp:xml> question

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Danny Ni

    <asp:xml> question

    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="txtAddres s"
    class="underlin e" onchange="updat e1();">
    </td>
    </tr>
    <tr>
    <td>
    Name: <input type="text" id="txtName" name="txtName" class="noborder "
    onchange="updat e1();">
    </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




  • Jeffrey Palermo [MCP]

    #2
    Re: &lt;asp:xml& gt; question

    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

    "Danny Ni" <dndn@yahoo.com > wrote in message
    news:ep17Xh90EH A.3900@TK2MSFTN GP10.phx.gbl...[color=blue]
    > Hi,
    >
    > I use the <asp:xml> control, xml and xslt to generate a HTML for users[/color]
    to[color=blue]
    > 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[/color]
    the[color=blue]
    > 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="txtAddres s"
    > class="underlin e" onchange="updat e1();">
    > </td>
    > </tr>
    > <tr>
    > <td>
    > Name: <input type="text" id="txtName" name="txtName" class="noborder "
    > onchange="updat e1();">
    > </td>
    > </tr>
    > </table>
    > The users can input something into address and name fields. In the web[/color]
    form[color=blue]
    > code behind file, I would like to get values user inputted.
    >
    > Thanks in Advance
    >
    >
    >
    >[/color]


    Comment

    Working...