G
Gaurav Gargate
Hi Group,
I am creating a ASP.NET (C#) project.
I am creating a datalist with some dynamically generated text boxes in the
edit template.
I have the datalist control on the form. The text box is written on the form
at run time.
Using Response.Write() on the EditTemplate I write the HTML code required
for the text box along with the data and the ID for the text box.
On the Update event of the datalist I try to read the value from the text
box.
I am doing a FindControl (<text box id which was inserted into the HTML
code>).
But I get an 'Object reference not set to an instance of an object' error.
When I put a text box in the EditTemplate of the datalist at the design
time, I can read the values of the data in it.
But the same does not happen when the text box is created on run time...
How can I read the data from the text box created at run time.
Should I use a different method of creating a text box at run time, instead
of writing the HTML code on the form.
Thanks in advance,
Gaurav
I am creating a ASP.NET (C#) project.
I am creating a datalist with some dynamically generated text boxes in the
edit template.
I have the datalist control on the form. The text box is written on the form
at run time.
Using Response.Write() on the EditTemplate I write the HTML code required
for the text box along with the data and the ID for the text box.
On the Update event of the datalist I try to read the value from the text
box.
I am doing a FindControl (<text box id which was inserted into the HTML
code>).
But I get an 'Object reference not set to an instance of an object' error.
When I put a text box in the EditTemplate of the datalist at the design
time, I can read the values of the data in it.
But the same does not happen when the text box is created on run time...
How can I read the data from the text box created at run time.
Should I use a different method of creating a text box at run time, instead
of writing the HTML code on the form.
Thanks in advance,
Gaurav