I finally got the client side script to work. What is strange is how
all of my controls are set to runat="server". I have a button, a text
box, and an activex component all running with the runat="server" tag,
but when I run them remotely, the app behaves as if they are all
running on the local client. It is strange that if I take this code
and just define everything in the aspx page instead of going about from
code behind, I get the guid error. If I take the wrapped activex
control and define it in code behind, I can't seem to figure out how to
add it to the webpage. In a windows form, I just drag and drop the
object onto the form.
{
HtmlInputText rdpText = new HtmlInputText();
rdpText.Attributes.Add("type", "text");
rdpText.Attributes.Add("id", "text1");
//rdpText.Attributes.Add("value", "text");
rdpText.Attributes["runat"] = "server";
Page.Controls.Add(rdpText);
HtmlInputButton rdpButton = new HtmlInputButton();
rdpButton.Attributes.Add("type", "button");
rdpButton.Attributes.Add("id", "button1");
rdpButton.Attributes.Add("name", "button1");
rdpButton.Attributes.Add("value", "Connect");
rdpButton.Attributes["runat"] = "server";
rdpButton.Attributes.Add("onclick", "return
Button1_onclick()");
Page.Controls.Add(rdpButton);
HtmlGenericControl rdp = new HtmlGenericControl("object");
rdp.Attributes["id"] = "rdp";
rdp.Attributes["name"] = "rdp";
rdp.Attributes.Add("classid",
"clsid:7584c670-2274-4efb-b00b-d6aaba6d3850");
rdp.Attributes["runat"] = "server";
rdp.Attributes["width"] = "1034";
rdp.Attributes["height"] = "778";
Page.Controls.Add(rdp);
HtmlGenericControl rdpFunctions = new
HtmlGenericControl("script");
rdpFunctions.Attributes.Add("type", "text/javascript");
rdpFunctions.Attributes.Add("language", "javascript");
rdpFunctions.Attributes["runat"] = "server";
string rdpConnect = "function Button1_onclick()" +
"{" +
"rdp.Width=1034;" +
"rdp.Height=778;" +
"rdp.DesktopWidth=1024;" +
"rdp.DesktopHeight=768;" +
"rdp.Server=text1.value;" +
"rdp.Connect();" +
"}";
string rdpDisconnect = " function disconnect()" +
"{" +
"rdp.Disconnect();" +
"}";
rdpFunctions.InnerHtml = rdpConnect;
rdpFunctions.InnerHtml = rdpFunctions.InnerHtml +
rdpDisconnect;
Page.Controls.Add(rdpFunctions);