Can't get the updated value on the postback

G

Guest

Hi

I have html table control runat = 'sever'

I run some client side javacript to insert rows of data into the htmltable,
does anyone know how to get the inserted value on the postback?

I did try to set the control's enableviewstate to true, no luck.

Please help!

Thanks
Ann
 
P

pjbates

I don't think EnableViewState is going to help you.

The viewstate is stored in a hidden field thats injected into the page
on creation. You can see this by looking at the page source of any aspx
produced page.

""""
<input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
value="RnkBWQQvIlCaelwoFv66rW/69Hkq0jfasNnUiaYpmZOayYK/.......
""""""

Unless you can produce some JS to correctly alter the viewstate field
(bad idea), then nothing your JS is doing to the document is going to
magically post back. Even if you could alter the viewstate, I doubt
that any information related to HtmlTable is stored in there, as
HtmlTable is really only intended for data display, not editing.

Are the rows been added in responce to user actions, or as part of the
page setup?

If it's just page setup, you're better off adding to rows to the aspx
page, or using the PageLoad method to call HtmlTable.Rows.Add()

If the users are adding data, have you considered using GridView? It
can be bound to an ObjectDataSource or XmlDataSource as well as a SQL
database.

As a general note, mixing fancy 3rd party JS with ASP.NET is never
going to be clean and easy.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,567
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top