Can't get the updated value on the postback

Discussion in 'ASP .Net' started by =?Utf-8?B?QW5u?=, Jun 24, 2005.

  1. 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
     
    =?Utf-8?B?QW5u?=, Jun 24, 2005
    #1
    1. Advertising

  2. =?Utf-8?B?QW5u?=

    pjbates Guest

    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.
     
    pjbates, Jun 24, 2005
    #2
    1. Advertising

  3. =?Utf-8?B?QW5u?=

    Patrice Guest

    What do you post ? Only field forms are posted to the server...

    Patrice

    --

    "Ann" <> a écrit dans le message de
    news:...
    > 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
     
    Patrice, Jun 24, 2005
    #3
    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. Replies:
    1
    Views:
    3,473
    Elton Wang
    Mar 30, 2005
  2. ibiza
    Replies:
    2
    Views:
    3,998
    ibiza
    Feb 28, 2006
  3. Clara
    Replies:
    4
    Views:
    374
    Clara
    Apr 20, 2005
  4. Clara
    Replies:
    0
    Views:
    333
    Clara
    Apr 20, 2005
  5. Dmitry Korolyov

    Datagrid not updated during delete, but updated during insert and update

    Dmitry Korolyov, Sep 22, 2003, in forum: ASP .Net Datagrid Control
    Replies:
    0
    Views:
    439
    Dmitry Korolyov
    Sep 22, 2003
Loading...

Share This Page