-
using .net remoting,and adding a control on client application.
Hi
I am creating a TextBox on remote machine using .net remoting,and adding
that control on client application.
I am getting the textbox on client, but when I am adding this on a form
, it is showing the error. Can anyone can help me on this.
/***********/
using System;
using System.Data;
using System.Windows.Forms;
namespace nspace{
public class RemoteDataObject : MarshalByRefObject{
public RemoteDataObject(){
Console.WriteLine("Constructor has called New One");
}
public Button GetControl(){
Button button = new Button();
button.Text = "Hi I am created on Remote";
return button;
}
}
}
/************/
/********On Client***********
RemoteDataObject obj;
Button button;
try{
obj = new RemoteDataObject();
button =(Button) obj.GetControl();
if (button == null){
Console.WriteLine("button is null");
}
else{
Console.WriteLine(button.Text);
this.Controls.Add(button);
}
Console.WriteLine("Done Successfully Adding Remote Control");
}catch(Exception ex)
{
Console.WriteLine(ex.Message);
}
/*************/
output
-----
Hi I am created on Remote
Permission denied: cannot call non-public or static methods remotely.
Regards
Bastianham
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks