Getting dynamic elements' properties in C# - similar to getElementById in JS

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • AGOL
    New Member
    • Feb 2010
    • 2

    Getting dynamic elements' properties in C# - similar to getElementById in JS

    I have a page where fields are added dynamically by a JS running at the page load. So in the page I have html code like this
    Code:
    <TR id='TR_A1' style='display:block'>
       <TD id='A1Name' name='A1Name' >A1</TD>
       <TD> <textarea  ID='A1Value' name='A1Value' rows='6' cols='45'></textarea></TD>
    </TR>
    How can I access this element in c# when a button is clicked - I'm looking for something like getElementById( 'A1') in JavaScript

    Thanks
    Avish
    Last edited by AGOL; Mar 10 '10, 09:48 AM. Reason: typo
  • Plater
    Recognized Expert Expert
    • Apr 2007
    • 7872

    #2
    If they are made in the javascript, they don't exist on the server side.
    What you can do, is during a postback, tell the serverside about them.
    (Use hidden fields, etc)

    EDIT: if the TABLE itself is a server side component, it might be possible to see rows added by javascript on a postback

    Comment

    Working...