I have a controll that i have built for testing. It will open up in IE and will run the simple code it has inside it. However i am not able to pass it any data. Im using VS 2008 C# and IE 7.
Clicking on the button in the form dose not cause any action in the controll
This is my control
Here is the web pageCode:using System; using System.Collections.Generic; using System.ComponentModel; using System.Drawing; using System.Data; using System.Text; using System.Windows.Forms; namespace WindowsControlLibrary1 { public partial class UserControl1 : UserControl { private string someString = ""; private bool isSet; public UserControl1() { InitializeComponent(); } public string SomeString { set { someString = value; } } private void timer1_Tick(object sender, EventArgs e) { label1.Text = DateTime.Now.ToLongDateString(); button1.Text = someString; textBox1.Text = (isSet == true)?"Fish":"Food"; isSet = !isSet; } private void textBox1_TextChanged(object sender, EventArgs e) { } } }
Any ideas?Code:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <html> <body color=white> <hr> <font face=arial size=1> <OBJECT id="myControl1" name="myControl1" classid="WindowsControlLibrary1.dll#WindowsControlLibrary1.UserControl1" width=150 height=150> </OBJECT> </font> <form name="frm" id="frm"> <input type="text" name="txt" value="enter text here"><input type=button value="Click me" onClick="doScript();"> </form> <hr> </body> <script language="javascript"> function doScript() { myControl1.SomeString = frm.txt.value; } </script> </html>




Reply With Quote