Loosing informations when PostBack

Discussion in 'ASP .Net' started by =?Utf-8?B?RmxvcmVudA==?=, Apr 27, 2004.

  1. Hi all

    I'm developping an ASPX application with C# code behind, with Visual Studio 2003 and .NET 1.1

    In my form, I have a DropDownList (filled), and an empty Table (web form), which i want to fill when something is selected in my DropDownList

    The problem is : when i select something in my DropDownList, I fill the table with whatever i want, and everything is OK. But then, in the next PostBack (with a submit button or whatever else), all the data filled in my Table is lost! I can't retrieve it

    This is a problem because here is how I want my application to work : when someone arrives on my page, he just sees the DropDownList. He selects what he wants in it, and it is displayed in the tab, which is filled with text and checkBoxes. Then, he can click on a submit button to validate his modifications. But the problem is that in the function that is called by the eventHandler of my submit button, when i try to access my table, it is empty...

    EnableViewState is set to True for all my controls

    Could anybody help me out of here

    Thanks

    Floren
    =?Utf-8?B?RmxvcmVudA==?=, Apr 27, 2004
    #1
    1. Advertising

  2. Hi, Florent,

    Whatever control you add dynamically to the page needs to be added once
    again on the next post-back in order to remain visible. On the other hand,
    if you don't need the controls after the post back you can still access the
    posted values using the Request.Form collection.

    Hope this helps
    Martin
    "Florent" <> wrote in message
    news:...
    > Hi all,
    >
    > I'm developping an ASPX application with C# code behind, with Visual

    Studio 2003 and .NET 1.1 .
    >
    > In my form, I have a DropDownList (filled), and an empty Table (web form),

    which i want to fill when something is selected in my DropDownList.
    >
    > The problem is : when i select something in my DropDownList, I fill the

    table with whatever i want, and everything is OK. But then, in the next
    PostBack (with a submit button or whatever else), all the data filled in my
    Table is lost! I can't retrieve it.
    >
    > This is a problem because here is how I want my application to work : when

    someone arrives on my page, he just sees the DropDownList. He selects what
    he wants in it, and it is displayed in the tab, which is filled with text
    and checkBoxes. Then, he can click on a submit button to validate his
    modifications. But the problem is that in the function that is called by the
    eventHandler of my submit button, when i try to access my table, it is
    empty....
    >
    > EnableViewState is set to True for all my controls.
    >
    > Could anybody help me out of here?
    >
    > Thanks,
    >
    > Florent
    >
    >
    Martin Dechev, Apr 27, 2004
    #2
    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. Lionel
    Replies:
    0
    Views:
    396
    Lionel
    Aug 23, 2004
  2. =?Utf-8?B?bWc=?=

    Avoid loosing html array after postback

    =?Utf-8?B?bWc=?=, Sep 15, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    385
    Konrad Rotuski
    Sep 15, 2004
  3. Lionel

    IPTC informations

    Lionel, Jan 28, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    1,273
    Kevin Spencer
    Jan 28, 2005
  4. John Holgerson
    Replies:
    3
    Views:
    44,429
  5. Gauthier Segay

    Loosing ViewState on postback

    Gauthier Segay, Aug 10, 2005, in forum: ASP .Net
    Replies:
    6
    Views:
    3,046
    Gauthier Segay
    Aug 10, 2005
Loading...

Share This Page