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