yusuf

yusuf

  • NA
  • 9
  • 0

Embed a C# usercontrol in a HTML page

Nov 28 2005 1:24 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-- kindly 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();

}

 

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

 


Answers (2)