views:

35

answers:

3

Let me explain the case;

On the asp.net page, i have a repeater which generates <tr>s and <td>s.

On clientside, i have a js function which adds or deletes rows into that repeater-generated-table.

The problem is, in this function, i dont only generate a simple row, a textbox (which i have to get its value on server side) is generated too.

Is there any way to get value of client-generated controls ?

A: 

You can use AJAX to make the connection between the client side and the server side. You can try THIS or read THIS article.

o15a3d4l11s2
That wont help. Those links are generic "Using AJAX". He doesnt need to "retrieve" values from the server, he needs to access dynamically created HTML elements FROM the server.
RPM1984
A: 

At first glance, I would say you can write an AJAX request to send to the server the content of your textbox and act accordingly.

Beware though, that it can never interact with the server during a page generation cycle.

Olivier H
A: 

For who is interested in this topic, Request.Form solved my problem.

Here is the code

The pattern of the name propery is for example: name="txtReturnCause_56"

Dictionary<int, string> ReturnCauses = new Dictionary<int, string>();

            foreach (var key in Request.Form.AllKeys)
                if (key.StartsWith("txtReturnCause"))
                {
                    int _key = key.Split(char.Parse("_"))[1].ToInt();
                    string value = Request.Form[key];
                    ReturnCauses.Add(_key, value);
                }
Batu
Maybe i should have posted my comment as an answer. :) Glad it worked anyway.
RPM1984
@Batu please mention that @RPM1984 helped you find the solution. It's not nice to not acknowledge someone's help
Mouhannad
actually, i did my best by voting up the comment which he posted under my question. wish he had answered instead of commenting though.anyway, thanks @RPM1984 for your lead
Batu
No problems @Batu. Just glad you got it sorted.
RPM1984