private void PageMethodsWebFormsDelete() { if (lstPageMethodsWebForms.SelectedItems.Count != 1) { MessageBox.Show("Please select one item in the list.", "PageMethods WebForms - Delete"); return; } int theId = 0; if (int.TryParse((string)lstPageMethodsWebForms.SelectedItems[0].Tag, out theId)) { ProxyConfiguration config = new ProxyConfiguration("http://localhost:59878"); IFooPageMethods fooSvc = SimpleProxy.Proxy.For<IFooPageMethods>(config); fooSvc.Delete(new FooByIdParameters { id = theId }); } else { MessageBox.Show("Invalid Foo.", "PageMethods WebForms - Delete"); lstPageMethodsWebForms.SelectedItems.Clear(); } PageMethodsWebFormsRefresh(); }