Tech Off Thread

4 posts

Retrieve hiddentextbox value using xslt??

Back to Forum: Tech Off
  • User profile image
    venkatzeus

    Hi..

    I have a hidden text box value in my xslt page . Could anyone please help in retrieving the hidden text box value through xslt and assign the hidden textbox value to a variable?

  • User profile image
    davemc

    Hi,

    If you want to assign a value to a hidden variable, just extract the value of the relevant node into the value attribute like so:

    <input type="hidden" name="myinputbox" value="{xpath}" />

    where 'xpath' is obviously the xpath to the value you want, and you do need the curly braces Smiley

    You can't assign the hidden field value to an xslt variable, as the xslt has already been rendered as HTML/XHTML by this time, I think you may be getting a little muddled in your timings ...

    Simply posting the page back will give you the value in the hidden field as part of the Form Variables.

    Cheers

  • User profile image
    venkatzeus

    Thank you.
     How to postback in xslt to get the hidden box value?

  • User profile image
    davemc

    You don't postback in xslt.  xslt is used to render the html/xhtml page.  You post back from the rendered page using the standard submit button or a button linked to a javascript function which calls the submit() method of the form in the html.

    It's all a question of getting the right data into the right place to start with, then it makes you page very simple.  However, you may still have to resort to javascript or rely on the actions of standard aspnet controls to get you data back to the server. Remember your html/xhtml/aspx page in the client has no knowledge of the server!

Comments closed

Comments have been closed since this content was published more than 30 days ago, but if you'd like to continue the conversation, please create a new thread in our Forums, or Contact Us and let us know.