C# ebay sdk ComboBox linking selectedindexchanged event to button click

时间:2015-09-01 21:32:41

标签: c# combobox

I am making a web request from button click event and selecting category from combo box index change event. How do I link my request made in the button click event to the category selection made from the combo box selected index changed event?

private void button3_Click_1(object sender, EventArgs e)
{

            CustomFindingService service = new CustomFindingService();
            service.Url = "https://svcs.ebay.com/services/search/FindingService/v1?";


            FindCompletedItemsRequest request = new      FindCompletedItemsRequest();
    request.categoryId = selectedItem.ToString();                
}

private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
{
    if (selectedItem.ToString() == "Cell Phones & Accessories")
    {
        this.comboBox2.Text = "";
        comboBox2.Items.Clear();
        this.comboBox2.Items.AddRange(catCellPhones2);

        selectedItem = "15032";               
    }
}

1 个答案:

答案 0 :(得分:0)

you need to wire up an instance of HttpWebRequest which is found in the System.Net namespace, take a look at this link which should give you everything you need to call

https://msdn.microsoft.com/en-us/library/system.net.httpwebrequest(v=vs.110).aspx

If you need anymore examples, give me a shout and ill see if i can did one out for you