在网页中嵌入 Windows 窗体用户控件的步骤窗体、控件、步骤、网页

2023-09-09 21:10:39 作者:卜壊的男亼

我正在 Visual Studio 2005 中开发一个 Windows 窗体用户控件.它是一个文件上传控件,仅使用 2 个元素.

I am developing a windows forms user control in Visual Studio 2005. It is a file upload control and uses only 2 elements.

用于显示 opnefiledialog 的按钮打开文件对话框

我已经在 html 页面中添加了一个带有类 ID 和所有内容的对象标签.

I have added an object tag to the html page with the class id and all that.

<OBJECT id="myControl1" name="myControl1" classid="ActiveXUploadFile.dll#ActiveXUploadFile.FileUpload" width=288 height=300></OBJECT>

命名空间是 ActiveXUploadFile,类名是 FileUpload.

The namespace is ActiveXUploadFile and class name is FileUpload.

但是网页中没有显示控件.

But the control is not displayed in the web page.

还有什么要做的吗?

谢谢

推荐答案

提供classid属性的完整url

Provide the complete url for the classid attribute

例如:classid="http://localhost/FirstServiceTestForm.dll#TestForm.myControl"

ex: classid="http://localhost/FirstServiceTestForm.dll#TestForm.myControl"