简体   繁体   中英

C# ebay sdk ComboBox linking selectedindexchanged event to button click

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";               
    }
}

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM