By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
440,602 Members | 1,533 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 440,602 IT Pros & Developers. It's quick & easy.

Loosing informations when PostBack

P: n/a
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
Nov 18 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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" <an*******@discussions.microsoft.com> wrote in message
news:BA**********************************@microsof t.com...
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


Nov 18 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.