yusuf

yusuf

  • NA
  • 9
  • 0

Embed a C# usercontrol to a HTML webpage and run it in Tomcat 3.2.3

Nov 23 2005 3:53 AM

Hello Sir,
Thanks for your time.

My question is- Can we embed a usercontrol written in C# to a plain HTML page.if yes? then how.
i want to run this webpage in a TOMCAT v3.2.3 not IIS.when i try the same in IIS, its working perfectly.
Below is my code snippet-- kindlt correct me and give me a solution ,thank you.

Usercontrol code -

using System;

using System.Collections;

using System.ComponentModel;

using System.Drawing;

using System.Data;

using System.Windows.Forms;

namespace windows_Activex

{

public class NBuserControlTextbox : System.Windows.Forms.UserControl

{

private System.Windows.Forms.TextBox CTL_txtbox1;

private System.Windows.Forms.Button CTL_cmdClick;

private System.ComponentModel.Container components = null;

public NBuserControlTextbox()

{

InitializeComponent();

}

protected override void Dispose( bool disposing )

{

if( disposing )

{

if(components != null)

{

components.Dispose();

}

}

base.Dispose( disposing );

}

#region Component Designer generated code

private void InitializeComponent()

{

this.CTL_txtbox1 = new System.Windows.Forms.TextBox();

this.CTL_cmdClick = new System.Windows.Forms.Button();

this.SuspendLayout();

 

this.CTL_txtbox1.BorderStyle = System.Windows.Forms.BorderStyle.FixedSingle;

this.CTL_txtbox1.Location = new System.Drawing.Point(48, 48);

this.CTL_txtbox1.Name = "CTL_txtbox1";

this.CTL_txtbox1.Size = new System.Drawing.Size(176, 20);

this.CTL_txtbox1.TabIndex = 0;

this.CTL_txtbox1.Text = "";

 

this.CTL_cmdClick.Location = new System.Drawing.Point(88, 88);

this.CTL_cmdClick.Name = "CTL_cmdClick";

this.CTL_cmdClick.Size = new System.Drawing.Size(88, 24);

this.CTL_cmdClick.TabIndex = 1;

this.CTL_cmdClick.Text = "Click";

this.CTL_cmdClick.Click += new System.EventHandler(this.CTL_cmdClick_Click);

this.Controls.AddRange(new System.Windows.Forms.Control[] {

this.CTL_cmdClick,

this.CTL_txtbox1});

this.Name = "NBuserControlTextbox";

this.Size = new System.Drawing.Size(304, 150);

this.ResumeLayout(false);

}

#endregion

private void CTL_cmdClick_Click(object sender, System.EventArgs e)

{

CTL_txtbox1.Text = "Button Clicked";

}
public static void Main(string[] args)

{MessageBox.Show("Application Started");}
}
}

HTML page

<html>
  <body>
    <center>Click the button</center>
 <object id="windows_Activex" height="250" width="300"
    classid="..newbreak/windows_Activex.dll#windows_Activex.NBuserControlTextbox">
      </object>
  <body>
</html>

THats abt it.

i would be grateful if u can give me an solution to this...
Thanks!

Yusuf