locked
xml string in html element

    Question

  • Hi

    Is there a way to "store" an xml string retrieved from the database in an html element, that has been created dynamically?

    basically i would like to do this:

    <select>
    <option name="test" xmlValue="<?xml version='1.0'?>
    <FiltersViewModel xmlns:xsi='http://www.w3.org/2001/XMLSchema-instance' xmlns:xsd='http://www.w3.org/2001/XMLSchema'>
    </FiltersViewModel>">test</option>
    </select>
     

    in a  windows 8 app where the drop down list gets created dynamically, currently we use the "toStaticHTML()" method to create the dynamic list, but this removes all tags.

    I want to rather store each items xml as I thought when we query the db, the xml is returned as well, so I dont want to go back to get the xml and then use that xml for another function, i would like to just store it in the drop down for easier access.

    Thank you

    Sasha

    Tuesday, October 15, 2013 7:09 AM

Answers

  • Did you try Hidden fields in HTML ? There are server side versions also available in ASP.NET for them.

    <asp:HiddenField
        EnableTheming="True|False"
        EnableViewState="True|False"
        ID="string"
        OnDataBinding="DataBinding event handler"
        OnDisposed="Disposed event handler"
        OnInit="Init event handler"
        OnLoad="Load event handler"
        OnPreRender="PreRender event handler"
        OnUnload="Unload event handler"
        OnValueChanged="ValueChanged event handler"
        runat="server"
        SkinID="string"
        Value="string"
        Visible="True|False"
    />

    Thanks,

    Amit Tonk

    ------------

    Please mark this as answer if this post help you.

    • Marked as answer by Sasha_za Tuesday, October 15, 2013 11:07 AM
    Tuesday, October 15, 2013 9:22 AM

All replies

  • Did you try Hidden fields in HTML ? There are server side versions also available in ASP.NET for them.

    <asp:HiddenField
        EnableTheming="True|False"
        EnableViewState="True|False"
        ID="string"
        OnDataBinding="DataBinding event handler"
        OnDisposed="Disposed event handler"
        OnInit="Init event handler"
        OnLoad="Load event handler"
        OnPreRender="PreRender event handler"
        OnUnload="Unload event handler"
        OnValueChanged="ValueChanged event handler"
        runat="server"
        SkinID="string"
        Value="string"
        Visible="True|False"
    />

    Thanks,

    Amit Tonk

    ------------

    Please mark this as answer if this post help you.

    • Marked as answer by Sasha_za Tuesday, October 15, 2013 11:07 AM
    Tuesday, October 15, 2013 9:22 AM
  • Hi Amit

    I just tried it, and thanks it works, was able to create hidden text fields.

    Thanks again

    Kind regards,

    Sasha

    Tuesday, October 15, 2013 11:07 AM