This message was discovered on microsoft.public.dotnet.framework.aspnet.webservices.
Responses highlighted in red are from those people who are likely to be able to contribute good, authoratitive information to this discussion. They include Microsoft employees, MVP's and others who IMHO contribute well to these kinds of discussions.
| caesar hernandez via .NET 247 (VIP) |
(Type your message here)
-------------------------------- From: caesar hernandez
Is it possible to return an Array of Controls that have defined events from a webservice to a consumer?
---------------------------------------- consumer: ---------------------------------------- controls = Webservice.CreateGUI()
---------------------------------------- webservice: ---------------------------------------- using System; using System.Collections; using System.ComponentModel; using System.Data; using System.Diagnostics; using System.Web; using System.Web.Services; using System.Windows.Forms; namespace GUIService{ public class GUIService1 : System.Web.Services.WebService{ [WebMethod] public Control[] InitializeInterface(){ Control[] cc = new Control[1]; Button but = new Button(); but.Location = new System.Drawing.Point(100, 100); but.Name = "button2"; but.Size = new System.Drawing.Size(128, 32); but.TabIndex = 0; but.Text = "button2"; but.Show(); but.Click += new System.EventHandler(this.button2_Click);
cc[0] = but;
return cc; }
private void button2_Click(object sender, System.EventArgs e){ MessageBox.Show("test"); } } }
I'd tried but I get a serialization error and cannot figure out the problem.
"Cannot serialize member System.ComponentModel.Component.Site of type System.ComponentModel.ISite because it is an interface."
Any help would be great. Thanks
----------------------- Posted by a user from .NET 247 (http://www.dotnet247.com/)
<Id>HVkbJN9iwkOOCeWOnrOHPg==</Id>
|
|
| |
| |
| Govind (VIP) |
Whatever you are returning from WebMethod shd be serializable. For that what you can do is store cotrol name & properties as XML DataSet and sendback to client. There can access the DataSet the can create the UI controls.
Regards, Govind.
"caesar hernandez via .NET 247" wrote:
[Original message clipped]
|
|
| |
|
|
|
|
|