C# .NET - access li from code behind in c# - Asked By hiral jani on 13-Aug-12 06:09 AM

Hello,

 I have 1 web application in c# where in 1 page I have created 20 dynamic ul li with no server tags as per requirement.

Now I want to save data of this li in database without using the runat="server".
Kindly give suggestion along with code / link for this.
senthil senthil replied to hiral jani on 13-Aug-12 07:22 AM
Hi
can you explain u r requirements little bit more ,it will help us to help u
Peter Bromberg replied to hiral jani on 13-Aug-12 08:00 AM
You would need to iterate the <li> elements via javascript, assemble the element values, and make an AJAX call to your server-side code to save it.

For example, to get an array of all <li> elements, you could write

var elements = document.GetElementByTagName("li");