关于在网页中插入自定义DLL控件的问题!!!! 1. how are you accessing the control? show some code?2. make sure you properly configured the permissions, seehttp://windowsforms.net/articles/iesourcing.aspx 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 <html><head><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><title>新建网页 1</title><script language=vbscript>sub bg() test.width=500 '这行可以工作 test.TitleNew=" has been clear." '这里提示错误,TitleNew为自定义属性end sub</script></head><body><object id="test" classid="http:DllTest.dll#DllTest.TestDll" width="150" height="150"></object><form method="POST" action="--WEBBOT-SELF--"> <p><input type="button" value="按钮" onclick="bg()" name="B3"></p></form></body></html>上面是调用的网页以下为测试控件的原码:using System;using System.Collections;using System.ComponentModel;using System.Drawing;using System.Data;using System.Windows.Forms;namespace DllTest{ /// <summary> /// UserControl1 的摘要说明。 /// </summary> public class TestDll : System.Windows.Forms.UserControl { private System.Windows.Forms.Button button1; private System.Windows.Forms.Label label1; /// <summary> /// 必需的设计器变量。 /// </summary> private System.ComponentModel.Container components = null; public TestDll() { // 该调用是 Windows.Forms 窗体设计器所必需的。 InitializeComponent(); // TODO: 在 InitComponent 调用后添加任何初始化 } /// <summary> /// 清理所有正在使用的资源。 /// </summary> protected override void Dispose( bool disposing ) { if( disposing ) { if( components != null ) components.Dispose(); } base.Dispose( disposing ); } #region 组件设计器生成的代码 /// <summary> /// 设计器支持所需的方法 - 不要使用代码编辑器 /// 修改此方法的内容。 /// </summary> private void InitializeComponent() { this.button1 = new System.Windows.Forms.Button(); this.label1 = new System.Windows.Forms.Label(); this.SuspendLayout(); // // button1 // this.button1.Location = new System.Drawing.Point(32, 64); this.button1.Name = "button1"; this.button1.TabIndex = 0; this.button1.Text = "button1"; this.button1.Click += new System.EventHandler(this.button1_Click); // // label1 // this.label1.Location = new System.Drawing.Point(24, 16); this.label1.Name = "label1"; this.label1.TabIndex = 1; this.label1.Text = "the title"; // // TestDll // this.Controls.Add(this.label1); this.Controls.Add(this.button1); this.Name = "TestDll"; this.ResumeLayout(false); } #endregion private void button1_Click(object sender, System.EventArgs e) { if(this.BackColor==Color.Blue) this.BackColor=System.Drawing.Color.Red; else this.BackColor=Color.Blue; } public string TitleNew { get { return this.label1.Text; } set { this.label1.Text=value; } } }}控件在网页中可以正确显示,且控件中的按钮工作正常,网页中的按钮在点击时,对于控件的自有属性可以工作(改变控件宽度),但自定义属性却无法工作,提示“控件不支持此属性或方法” it works fine with me on localhost1. did you see the button/label displayed in the browser?2. what browser are you using? 在线等,关于对出的问题。 asp.net webform或mvc怎么发增量包,解决每次发包都要全面测试问题? asp.net网站中引用web服务求助 sql判断? 如何格式化顯示日期? 2个table的行外观上要求一一对应 localhost 无法打开aspx <%# 在SQL的字段里面,有个"公司简介"在里面请问要用什么数据类型 %> 超级asp.net菜鸟问题,请教.. 新学asp.net,有个问题,哪位帮忙看看 cdo.message出错,查了好多资料还是无法解决... frameset显示问题,帮忙看看该怎么办?
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>新建网页 1</title>
<script language=vbscript>
sub bg()
test.width=500 '这行可以工作
test.TitleNew=" has been clear." '这里提示错误,TitleNew为自定义属性
end sub
</script>
</head><body>
<object id="test" classid="http:DllTest.dll#DllTest.TestDll" width="150" height="150">
</object>
<form method="POST" action="--WEBBOT-SELF--">
<p><input type="button" value="按钮" onclick="bg()" name="B3"></p>
</form>
</body>
</html>上面是调用的网页以下为测试控件的原码:
using System;
using System.Collections;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Windows.Forms;namespace DllTest
{
/// <summary>
/// UserControl1 的摘要说明。
/// </summary>
public class TestDll : System.Windows.Forms.UserControl
{
private System.Windows.Forms.Button button1;
private System.Windows.Forms.Label label1;
/// <summary>
/// 必需的设计器变量。
/// </summary>
private System.ComponentModel.Container components = null; public TestDll()
{
// 该调用是 Windows.Forms 窗体设计器所必需的。
InitializeComponent(); // TODO: 在 InitComponent 调用后添加任何初始化 } /// <summary>
/// 清理所有正在使用的资源。
/// </summary>
protected override void Dispose( bool disposing )
{
if( disposing )
{
if( components != null )
components.Dispose();
}
base.Dispose( disposing );
} #region 组件设计器生成的代码
/// <summary>
/// 设计器支持所需的方法 - 不要使用代码编辑器
/// 修改此方法的内容。
/// </summary>
private void InitializeComponent()
{
this.button1 = new System.Windows.Forms.Button();
this.label1 = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// button1
//
this.button1.Location = new System.Drawing.Point(32, 64);
this.button1.Name = "button1";
this.button1.TabIndex = 0;
this.button1.Text = "button1";
this.button1.Click += new System.EventHandler(this.button1_Click);
//
// label1
//
this.label1.Location = new System.Drawing.Point(24, 16);
this.label1.Name = "label1";
this.label1.TabIndex = 1;
this.label1.Text = "the title";
//
// TestDll
//
this.Controls.Add(this.label1);
this.Controls.Add(this.button1);
this.Name = "TestDll";
this.ResumeLayout(false); }
#endregion private void button1_Click(object sender, System.EventArgs e)
{
if(this.BackColor==Color.Blue)
this.BackColor=System.Drawing.Color.Red;
else
this.BackColor=Color.Blue;
} public string TitleNew
{
get
{
return this.label1.Text;
}
set
{
this.label1.Text=value;
}
} }
}
控件在网页中可以正确显示,且控件中的按钮工作正常,网页中的按钮在点击时,对于控件的自有属性可以工作(改变控件宽度),但自定义属性却无法工作,提示“控件不支持此属性或方法”
2. what browser are you using?