views:

269

answers:

4

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

  1. A button for showing opnefiledialog
  2. An openfiledialog

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>

The namespace is ActiveXUploadFile and class name is FileUpload.

But the control is not displayed in the web page.

Is there anything more to be done for this?

Thanks

A: 

Windows Forms and html really don't mix that well. Why don't you just use the asp control? Just add it to your aspx page like so:

<asp:FileUpload ID="FileUpload1" runat="server" />

Matthew

Matthew Talbert
The file upload is only for a demo purpose. I have to read USB data from the web page. For that I have to develop a windows forms user control.
rahul
Ah, that makes more sense.
Matthew Talbert
A: 

See this tutorial: http://www.15seconds.com/Issue/030610.htm

Ganesh R.
A: 

For doing this, the users will have to have .NET framework installed on their machines (most of the users have it). Then to view the control, they will have set the .NET security policies.

I had once used Atalasoft's .NET component for ASP.NET, and it required performing the settings given on this page.

You can try creating a normal COM ActiveX in .NET instead of a .NET web component. This way you'll only have to digitally sign it and the users will have to permit the control to be installed on their machine.

Kirtan
A: 

Provide the complete url for the classid attribute

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

kumar