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

Dynamic Controls in Panel - How to access them!

P: n/a
My code does the following...

It references a stored procedure and builds a PlaceHolder containing
certain controls, based on the parameters from the stored proc. This is
implemented in it's own class.

On the form, the user can select from a drop down box of many stored
procs. From that, parameter fields are created which the user can
change, in the PlaceHolder, and then added to the Panel on the form.

My problem is, when the user clicks "run" to run the proc, i cannot get
to the parameter fields.

I have read about how asp works, and that dynamic controls are not
'saved'. But i'm not sure what to do to recreate the controls.
Especially as the architecture is as so:

A panel on the form.
A class which extends a PlaceHolder, adds certain controls to it
determined by the stored procedure's parameter types. This placeholder
is added to the panel when the user clicks a new stored proc.
From this i simply want access to the controls to extract the data!


Can anyone help?

Dec 15 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
I advertize this product like I make money off every download (don't worry,
it's free), but it does sound like it might help you out, check out:
http://www.denisbauer.com/ASPNETCont...aceholder.aspx

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
http://openmymind.net/redirector.aspx?documentId=51 - Learn about AJAX!

<ar*********@gmail.com> wrote in message
news:11*********************@g47g2000cwa.googlegro ups.com...
My code does the following...

It references a stored procedure and builds a PlaceHolder containing
certain controls, based on the parameters from the stored proc. This is
implemented in it's own class.

On the form, the user can select from a drop down box of many stored
procs. From that, parameter fields are created which the user can
change, in the PlaceHolder, and then added to the Panel on the form.

My problem is, when the user clicks "run" to run the proc, i cannot get
to the parameter fields.

I have read about how asp works, and that dynamic controls are not
'saved'. But i'm not sure what to do to recreate the controls.
Especially as the architecture is as so:

A panel on the form.
A class which extends a PlaceHolder, adds certain controls to it
determined by the stored procedure's parameter types. This placeholder
is added to the panel when the user clicks a new stored proc.
From this i simply want access to the controls to extract the data!


Can anyone help?

Dec 15 '05 #2

P: n/a
Not sure if that can help me.

The difference with my problem is that there are a variable amount of
controls, and those controls are not the same.

Dec 15 '05 #3

P: n/a
Have you tried it?

It basically sounds like your problem is that controls are dynamically
added, but on postback they are lost and you cannot get their values.

The control I sent you is a placeholder which automatically reloads dynamic
controls during postback.

As I understand it, you only have 2 choices. Figure out which controls were
dynamically add them and re-add them yourself during INIT, or use a control
like this one that does it for you.

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
<ar*********@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com...
Not sure if that can help me.

The difference with my problem is that there are a variable amount of
controls, and those controls are not the same.

Dec 15 '05 #4

P: n/a
Hi,

Yeh i've added some code to add the controls again.
It works, except i have a little problem now where a variable sometimes
gets changed, and sometimes doesnt - depending on the asp sequence.

Need to figure that out.

Thanks

Dec 15 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.