Multiple Dropdowns in a user control

D

Damon

I am working on a site in which I would like to have two dropdowns that will
allow a user to navigate through the administrative pages of the site. The
first would allow the user to choose the particular site that they would
like to edit. The second would allow the user to select which admin screen
they would like to edit. The second dropdown needs to be populated based on
the selection in the first one. I want to encapsulate these dropdowns in
user controls so that I can easily add them to any page. Where I'm having
the most trouble is maintaining the state of the data from page to page
inside the user controls. Also, I was wondering if I should try to cache the
dropdowns or store them in a session object. Has anyone seen any examples of
this or have any good ideas on how to implement this type of functionaluty.
Any help would be greatly appreciated.
 
G

Guest

Hi Damon,

You wrote,
.....I want to encapsulate these dropdowns in user controls so that I can easily add them to any page. Where I'm having the most trouble is maintaining the state of the data from page to page inside the user controls. ...............

There are two things
1. You want to maintain state between postbacks on a the same page
2. You want to show the same data (in the first combo) in any page, once it is populated in any page.

Can you please clarify which one of the above you are dealing with (or is it some thing else) .

thanks
Nithin P V
 
D

Damon

I'm trying to do both. Here's how I'm trying to make it work.

A user logs into my site and goes to the main admin screen. They can have
multiple sites to administer and each site has multiple pages that can be
edited. So there are two dropdowns on this screen. The first will allow them
to choose a site to edit. The second one will allow them to choose which
page to edit on that site. The values in the second dropdown depend on which
site was selected in the first dropdown. I want them to have those two
dropboxes available no matter which page they are on.

Now to answer your question:

I'm trying to do #1 when a user edits a page. They will fill out the form
and click submit. That will cause the page to resubmit to itself to update
the database. So when the page reloads after the processing it should
maintain the state so that it will still have the dropdowns.

I'm trying to do #2 also. Whenever they choose an option in the first
dropdown I want them to be able to navigate around to different pages and
still retain the state of that dropdown. For example, the user will choose a
site (in the first dropdown) and then choose to edit page 1 (in the second
dropdown). After they are done editing page 1 then they could select page 2
(in the second dropdown). The state of the dropdowns would need to be
maintained through all these events.


The way I am trying to do all this is by putting the dropdowns in two
separate user controls and then including those controls in all the admin
pages. I'm open to other suggestions if there is a better way. I hope that
made things a little clearer.


Nithin said:
Hi Damon,

You wrote,
.....I want to encapsulate these dropdowns in user controls so that I can
easily add them to any page. Where I'm having the most trouble is
maintaining the state of the data from page to page inside the user
controls. ...............
 
R

RM82

Hi there Damon,

Did you find a solution to this, i am also trying to add two drop dow
lists into one user control with no luck at the moment, some advic
would be much appreciated

Thanks,

Ro

RM8
 
C

Corey O'Mara

User controls are composite controls, so they should handle multiple
dropdowns without a problem. Perhaps you're having a databing issue? Let us
know exactly what you're trying to do and what the problem is that you're
seeing.
 

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

Forum statistics

Threads
473,744
Messages
2,569,482
Members
44,900
Latest member
Nell636132

Latest Threads

Top