access dynamically added controls

Discussion in 'ASP .Net Building Controls' started by sivagururaja@gmail.com, Jun 8, 2007.

  1. Guest

    Dear All,

    Im using ASP.NET 2.0 with C#.
    In my aspx page, i have one HTML Table.
    Using the javascript i add the rows dynamically.

    1.What my problem is how can i access those controls.
    When i click the submit button, i lose all those rows that were
    added dynamically.
    How can i persist those rows and how can i access the controls.

    2.Also 'm using many checkboxes in cell2 of each row.
    I want to manipulate whether it's checked or not. So i count the
    number of checkboxes and loop through all the controls,
    so that i validate whether it's checked or not. How can i count the
    controls. Is there any syntax in Javascript like this
    Cell2.Controls.Count ?

    Help me to over come this problem...
    Thanks a lot.
    Regards
    Raja.
    , Jun 8, 2007
    #1
    1. Advertising

  2. Teemu Keiski Guest

    You'd need to work the creation of the controls on the server-side (pass
    information from client to server what to create). It can take some cycles,
    and if you want it look like that to the user, you could just use ASP.NET
    Ajax's UpdatePanel, this way you'd develop like for client-side but it looks
    like as if it happens at the client.

    JavaScript does have syntac for that. You'd iterate though form's elements
    or childNodes of a given node or then like this:
    http://geekswithblogs.net/mparsons/archive/2006/03/02/71175.aspx there are
    lots of alternatives


    --
    Teemu Keiski
    AspInsider, ASP.NET MVP
    http://blogs.aspadvice.com/joteke
    http://teemukeiski.net


    <> wrote in message
    news:...
    > Dear All,
    >
    > Im using ASP.NET 2.0 with C#.
    > In my aspx page, i have one HTML Table.
    > Using the javascript i add the rows dynamically.
    >
    > 1.What my problem is how can i access those controls.
    > When i click the submit button, i lose all those rows that were
    > added dynamically.
    > How can i persist those rows and how can i access the controls.
    >
    > 2.Also 'm using many checkboxes in cell2 of each row.
    > I want to manipulate whether it's checked or not. So i count the
    > number of checkboxes and loop through all the controls,
    > so that i validate whether it's checked or not. How can i count the
    > controls. Is there any syntax in Javascript like this
    > Cell2.Controls.Count ?
    >
    > Help me to over come this problem...
    > Thanks a lot.
    > Regards
    > Raja.
    >
    Teemu Keiski, Jun 13, 2007
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Harry
    Replies:
    1
    Views:
    1,658
    Natty Gur
    Jun 25, 2003
  2. NotYetaNurd
    Replies:
    1
    Views:
    449
    John Saunders
    Nov 7, 2003
  3. Jeffrey Todd
    Replies:
    1
    Views:
    4,091
    Peter Blum
    Jun 2, 2005
  4. David Hubbard
    Replies:
    2
    Views:
    617
    David Hubbard
    Jan 17, 2006
  5. ENathan

    existing controls overlaying dynamically added controls

    ENathan, Jan 10, 2005, in forum: ASP .Net Web Controls
    Replies:
    2
    Views:
    193
    Steve C. Orr [MVP, MCSD]
    Jan 10, 2005
Loading...

Share This Page