Re: Are dynamically loaded controls preserved over a postback?
- From: Alan Silver <alan-silver@xxxxxxxxxxxx>
- Date: Mon, 8 Aug 2005 20:40:37 +0100
you have to recreate the dynamic comtrol on postback. there is no code in the placeholder for this.
If I recreate the user control, will the child controls have their values preserved? The point of this is that I want to get the value of a dropdownlist in the user control. If the value of that dropdownlist isn't preserved (ie if recreating the user control resets the child controls), then I'm wasting my time.
Thanks for the reply.
-- bruce (sqlwork.com)
"Alan Silver" <alan-silver@xxxxxxxxxxxx> wrote in message kbQ$lsKW569CFwf$@nospamthankyou.spam">news:kbQ$lsKW569CFwf$@nospamthankyou.spam...Hello,
I have a placeholder, which gets a user control added in when the page first loads. This user control contains a dropdownlist, and I would like to get hold of the value of this drop down list form the calling page on postback. Can I do this? If I try and use FindControl on the placeholder, it can't find the dropdownlist.
I tried...
ShowCategory ctlShowCategory = (ShowCategory)plcCategoryDetails.Controls[0];
(where ShowCategory is the user control) but this gave the error...
System.ArgumentOutOfRangeException: Specified argument was out of the range of valid values. Parameter name: index
which sounds like the user control wasn't preserved in the placeholder over the postback.
Any ideas how I do this? Hope this was clear!! TIA
-- Alan Silver (anything added below this line is nothing to do with me)
-- Alan Silver (anything added below this line is nothing to do with me) .
- Follow-Ups:
- Re: Are dynamically loaded controls preserved over a postback?
- From: Bruce Barker
- Re: Are dynamically loaded controls preserved over a postback?
- From: Phillip Williams
- Re: Are dynamically loaded controls preserved over a postback?
- References:
- Are dynamically loaded controls preserved over a postback?
- From: Alan Silver
- Re: Are dynamically loaded controls preserved over a postback?
- From: Bruce Barker
- Are dynamically loaded controls preserved over a postback?
- Prev by Date: Re: Turning on/off all of the debugging information.....
- Next by Date: Re: Dropdown list bug
- Previous by thread: Re: Are dynamically loaded controls preserved over a postback?
- Next by thread: Re: Are dynamically loaded controls preserved over a postback?
- Index(es):
Relevant Pages
|