Code Example: 1 controller and many views


Hi,

I would like to have a large project code example that shows interaction between 1 controller and many views.

Thanks
TungVanAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

pallospCommented:
Is the technology used in the project Windows Forms or Web Forms?

For example, in ASP.NET

1. Create a MultiView control
2. Drag&drop View controls inside it
3. Create a DropDownList, and fill with the names of the views
4. In the SelectedIndexChanged event handler of the dropdownlist write the following code:

    protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e) {
        MultiView1.ActiveViewIndex = DropDownList1.SelectedIndex;
    }
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
TungVanAuthor Commented:

I would like an example in windows form.

Thanks
0
pallospCommented:
It's a bit more complicated in Windows Forms unless you use TabControl.

You may create every view on a different Panel, move every Panel to the same position, and change their "Visible" property false. When the user selects another view, the proper Panel should be displayed.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
C#

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.