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

Placeholder's controls disappear during postback

P: n/a
Hi, I have a PlaceHolder on a place, to which I add a DropDownList (using
myPlaceHolder.Controls.Add(ddl). The user selects something from the
DropDownList and posts the page.

Now I try to get the value of what the user selected but the PlaceHolder's
Controls collection is empty. I've tried turning viewstate of the PlaceHolder
on and off but it doesn't make a difference (and I think I should be able to
leave it off).

What could be causing the PlaceHolder's controls to disappear? Shouldn't
they be carried with the form post?

Thanks.
Nov 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
If you are setting them up in your Page_Load based on certain events, you may
simply not be setting them up when it is a postback. If so, refactor to avoid
having them reset with postback.

---

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"Simon Wallis" wrote:
Hi, I have a PlaceHolder on a place, to which I add a DropDownList (using
myPlaceHolder.Controls.Add(ddl). The user selects something from the
DropDownList and posts the page.

Now I try to get the value of what the user selected but the PlaceHolder's
Controls collection is empty. I've tried turning viewstate of the PlaceHolder
on and off but it doesn't make a difference (and I think I should be able to
leave it off).

What could be causing the PlaceHolder's controls to disappear? Shouldn't
they be carried with the form post?

Thanks.

Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.