Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6743863
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T12:00:48+00:00 2026-05-26T12:00:48+00:00

I had made a main page and use user component to implement the style

  • 0

I had made a main page and use user component to implement the style of master page website. i make a drop down combo box to allow user choose their role in the combo box, may i know is that possible to call another user control with C# code beside from xaml while i need to do some logic statement.

i got one master page, loading another component with this combobox:

<ComboBox x:Name="cbRole" Height="30" Margin="8,8,8,100" VerticalAlignment="Top" ToolTipService.ToolTip="Please select your role to login" SelectionChanged="cbRole_SelectionChanged">
            <ComboBoxItem Content="Admin"/>
            <ComboBoxItem Content="Lecturer"/>
            <ComboBoxItem Content="Student"/>
    </ComboBox>

and the master page load the combo box with this line

<betata_Views_Sidebar:Sidebar/>

and i got a question on how to do this –>

private void cbRole_SelectionChanged(object sender, SelectionChangedEventArgs e)
    {
         int x = cbRole.SelectedIndex;
        if (x == 0)
        {
            <betata_Views_Sidebar:Sidebar_Admin/>
        }
        else if (x == 1) 
        {
            <betata_Views_Sidebar:Sidebar_Lecturer/>
        } 
        else if (x == 2)
        {
            <betata_Views_Sidebar:Sidebar_Student/>
        }
        else
        {
            ...
        }

    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T12:00:49+00:00Added an answer on May 26, 2026 at 12:00 pm

    why don’t you load them all and depending on the selected index, alter the visibility of the components?

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Had a page that was working fine. Only change I made was to add
I had made some questions regarding PHP-GTK (there are only 4 php-gtk tagged questions
I had made changes in a folder called branch, and now that its working
I had made a windows service in visual studio 2008 in C#. inside the
EDIT: I had made a mistake during the debugging session that lead me to
I Made label to had value from database and linked it . but the
I have a smallish utility library I made that I had created in TFS
I once had a MySQL database table containing 25 million records, which made even
Some of the answers to a question I had about redirect_to made me think
For some reason I've always had trouble remembering the backwards/forwards compatibility guarantees made by

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.