[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 239
  • Last Modified:

Dropdownlist selecting an item in the list

Hi, I have a dropdown list.  I am bounding this to a sharepoint list. All I want to do is be able to select one of the items in the dropdown and it to take me to the respective page.  How do I achieve this?

Thanks
0
mitesh114
Asked:
mitesh114
  • 3
  • 2
1 Solution
 
DhaestCommented:
What do you mean with goto respective page ? Does it show names of webpages, ... ?

Look at the following event
        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
              System.Windows.Forms.MessageBox.Show (comboBox1.SelectedText);
        }
0
 
mitesh114Author Commented:
Yes, it's a list of web page names and I pass their URL's as well. so I want to pick up the URL and get it to send to the page the user selects in the dropdownlist.
0
 
DhaestCommented:
       private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
              Response.Redirect (comboBox1.SelectedText);
        }
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
mitesh114Author Commented:
Thanks.  What I need is to pass through a description to display in the dropdown like this:
dlQuickLinks.Items.Add(Description)
I want to pass through the URL from the list as the value or  the unique identifier and then onchange do the redirect as you have showed above.  how would I do this?
0
 
CGI_PortalPracticeCommented:
What you need to do is create a ListItem value:

ListItem li = new ListItem("text", "value");
dlQuickLinks.Items.Add(li);

Then you can reference the value with:

private void dlQuickLinks_SelectedIndexChanged(object sender, EventArgs e)
        {
              Response.Redirect (dlQuickLinks.SelectedValue);
        }
0
 
mitesh114Author Commented:
thanks for your help guys
0

Featured Post

VIDEO: THE CONCERTO CLOUD FOR HEALTHCARE

Modern healthcare requires a modern cloud. View this brief video to understand how the Concerto Cloud for Healthcare can help your organization.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now