Loosing informations when PostBack

G

Guest

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
 
M

Martin Dechev

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 said:
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....
 

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

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top