Results 1 to 3 of 3

Thread: dynamically build <type="hidden"> elements with code behind

  1. #1

    Thread Starter
    Fanatic Member ZeBula8's Avatar
    Join Date
    Oct 2002
    Posts
    548

    Resolved dynamically build <type="hidden"> elements with code behind

    using asp.net:

    i have a hash collection and would
    like to iterate this collection and
    dynamically build <type="hidden"> elements
    on the html page and populate them with values
    from this collection.

    reason: I need to pass these values to another site.

    can this be done ?
    Last edited by ZeBula8; Nov 22nd, 2006 at 03:25 PM. Reason: [RESOLVED]

  2. #2
    Frenzied Member Fishcake's Avatar
    Join Date
    Feb 2001
    Location
    Derby, UK
    Posts
    1,092

    Re: dynamically build <type="hidden"> elements with code behind

    What version of .net are you using (always specify version )?

    If 1.0/1.1: look at Page.RegisterHiddenField
    if 2.0: look at ClientScript.RegisterHiddenField

  3. #3
    Addicted Member
    Join Date
    Dec 2004
    Posts
    143

    Re: dynamically build <type="hidden"> elements with code behind

    Or you could use a literal and populate that on the page load:

    ltlFields.Text = "<input type=""hidden"" name=""item_name"" value=""item_value" & iValue & """ />"

    HTH

    F

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width