Soledad Pano's Blog

Just Technical Stuff

Hosting a Windows Form Control in a web page

Although it is not the most common use of it, it is possible to host a Windows Form Control in a Web Page and run it from within Internet Explorer. This allows to build powerful client side functionality with all the advantages of using the .Net framework and executing the control in the client side. Of course there are some restrictions that cannot be left aside. At least the .Net framework must be installed on the client for the control to run. In addition, it is possible that some permission must be granted to the control, too, depending on the actions the control will take on the client machine.

Let’s build an example to see how this works:

1. Create the Windows Form Control

Create a “Windows Control Library” project in Visual Studio. For this simple example we will add a label to the control and a public “SendMessage” method to change the label’s text. In order to be able to call the method from IE, we will set the control’s COMVisible attribute to true.

 

using System;

using System.Windows.Forms;

using System.Runtime.InteropServices;

 

namespace WindowsControlLibrary1

{

    [ComVisible(true)]

    public partial class UserControl1 : UserControl

    {

        public UserControl1()

        {

            InitializeComponent();

        }

 

        public void SendMessage(string msg){

            _lblMessage.Text = msg;

        }

    }

}

 

2. Create the hosting HTML document

 

The control will be hosted using the HTML <object> element. In its classid attribute we will place the control's reference in the following manner: classid="http:[relativePath/]<winControlAssemblyName>.dll#<ControlNamespace>.<ControlClassName>". For this example we will have an HTML page (index.html) with the following code:

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >   
 <head>       
  <title>Windows Form Control Test Page</title>       
  <script type="text/javascript">           
    function SendMessageToWinControl()
    {                     
     var winCtrl = document.getElementById("MyWinControl");                   
     winCtrl.SendMessage("Message sent from the HTML page!!");               
    }       
  </script>   
 </head>   
 <body>       
  <h1>Windows Form Control:</h1>       
  <object id="MyWinControl" classid="http:WindowsControlLibrary1.dll#WindowsControlLibrary1.UserControl1"           
          height="100" width="300" VIEWASTEXT/>       
  <br/><br/>       
  <input type="button" onclick="SendMessageToWinControl()" value="Send Message" />   
 </body>
</html> 

  

3. Deploy the sample

 

Copy both the index.html page and the control library WindowControlLibrary1.dll to a directory (we will name it WinControlTest). In the “Web Sharing” dir properties select  Share this folder, leave the default alias and application permissions to Scripts and make sure not to select  the Execute permission).

 

4. Try it in Internet Explorer

 

Open the page http://localhost/WinControlTest/index.html in Internet Explorer. We can see the control hosted in the html page:

 

 

By clicking the Send Message button, we will call the Control's SendMessage method from javscript. Resulting in the label's text changed:

 

 

 

If you modify the control after its first use, you will need to close IE, replace the control's dll in the virtual directory and clean the contents of the download cache. You do this cleaning using the following command: "gacutil /cdl".To list the contents of the download cache use "gacutil /ldl".

 

This solution is not intended to replace a WebControl or any common web artifact. But is good to know it can be use in an uncommon scenario if needed.

 

Sole

 

Posted: Sep 19 2007, 03:56 PM by spano | with 38 comment(s)
Filed under: ,

Comments

Mau said:

Great howto. I've managed to do this. Now...i need to be able to read a simple text file, using the openfiledialog box, how do I grant permission to the control to do this? It seems it's an illegal action. I understand from what I've read that this can be done. Thanks in advance for your answers. :D This is the error it throws:

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

  at System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet)

  at System.Security.CodeAccessPermission.Demand()

  at System.Windows.Forms.FileDialog.set_Title(String value)

  at demoControl.UserControl1.button1_Click(Object sender, EventArgs e)

  at System.Windows.Forms.Control.OnClick(EventArgs e)

  at System.Windows.Forms.Button.OnClick(EventArgs e)

  at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)

  at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)

  at System.Windows.Forms.Control.WndProc(Message& m)

  at System.Windows.Forms.ButtonBase.WndProc(Message& m)

  at System.Windows.Forms.Button.WndProc(Message& m)

  at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

  at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

The action that failed was:

Demand

The type of the first permission that failed was:

System.Security.Permissions.FileIOPermission

The Zone of the assembly that failed was:

Trusted

************** Loaded Assemblies **************

mscorlib

   Assembly Version: 2.0.0.0

   Win32 Version: 2.0.50727.832 (QFE.050727-8300)

   CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

----------------------------------------

System

   Assembly Version: 2.0.0.0

   Win32 Version: 2.0.50727.832 (QFE.050727-8300)

   CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

----------------------------------------

demoControl

   Assembly Version: 1.0.2823.7184

   Win32 Version: n/a

   CodeBase: localhost/.../demoControl.dll

----------------------------------------

System.Windows.Forms

   Assembly Version: 2.0.0.0

   Win32 Version: 2.0.50727.832 (QFE.050727-8300)

   CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

----------------------------------------

System.Drawing

   Assembly Version: 2.0.0.0

   Win32 Version: 2.0.50727.832 (QFE.050727-8300)

   CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

----------------------------------------

Accessibility

   Assembly Version: 2.0.0.0

   Win32 Version: 2.0.50727.42 (RTM.050727-4200)

   CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll

----------------------------------------

Microsoft.mshtml

   Assembly Version: 7.0.3300.0

   Win32 Version: 7.0.3300.0

   CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll

----------------------------------------

************** JIT Debugging **************

To enable just-in-time (JIT) debugging, the .config file for this

application or computer (machine.config) must have the

jitDebugging value set in the system.windows.forms section.

The application must also be compiled with debugging

enabled.

For example:

<configuration>

   <system.windows.forms jitDebugging="true" />

</configuration>

When JIT debugging is enabled, any unhandled exception

will be sent to the JIT debugger registered on the computer

rather than be handled by this dialog box.

# September 24, 2007 6:11 AM

spano said:

Hi Mau, to grant permissions to your control go to Administrative Tools ->Microsoft  .Net Framework 2.0 Configuration. Under  My Computer -> Runtime Security Policy -> Machine -> Code Groups -> All_Code select New… to create a new Code Group. Set a descriptive name for the group, select URL as the condition type and enter the URL of you site, for example localhost/WinControlTest*. Finally assign the FullTrust permission set to the code group.  

For a production environment you should be more careful and assign only the minimum permissions instead of full trust and use a Strong Name condition type rather than a URL one. But for development purposes the above should work perfectly.

# September 27, 2007 12:21 PM

Mau said:

Hi spano :), do I have to import any libraries to my user Control? It seems i keep gettin the same error...Does it affect if I have say another .Net Framework config tool? I created a new group and set the condition type to URL, introduced http://localhost/Web/*  where the dll is but still I can't use the openfiledialog.

Thanks for the help and the effort spano.

# September 27, 2007 4:17 PM

spano said:

Mau, try changing the membership condition to All Code in the code group properties.

# October 7, 2007 11:06 PM

Juan Francisco said:

I make a control and i hosted it; but when i refresh the page, the control dissapears

Please do you have some solution

Thanks

# October 19, 2007 3:48 PM

Mau said:

Thanks Spano, that worked beautifully. Great work.

# October 20, 2007 3:33 AM

Newbie said:

Hi Spano, I tried your sample but the send message button seem to get lost. Did I miss something?

TIA,

John

# October 20, 2007 10:13 AM

Aswin Dwarakanath said:

This article is good. I did it and worked fine in localhost. But when I did in internet(my production web server) The control did not load at all. I modified the Security settings in IE also did include the controls under the URL as full Trust through the .NET Runtime. Nothing seems to work and the control will not load. Any help would be appreciated. I use IE6 SP2 on a Win XP.

Thanks in advance.

# October 24, 2007 2:10 PM

Juan Medina said:

Hi!

The example works great on IIS, but I seem unable to get it running when using the ASP.NET Development Server. Seems this mini-server does not allow Windows Forms to be run from it.

Am I wrong? Is there anything that can be done to test Windows Forms over ASP.NET Development Server?

Best Regards,

JUAN

# November 27, 2007 10:26 AM

Balu Munugoti said:

hi

really its great..after long search i found this article. i am using picturebox for capturing the webcam stream in windows control library using webcamlib.dll.

i have tested with windows application its working.i want is to embeded this into the web page..

is it possible to do this?

i got this unhandled error:

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.IO.FileNotFoundException: Could not load file or assembly 'WebCamLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

File name: 'WebCamLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

  at WinControls.WinTreeview.WinTreeview_Load(Object sender, EventArgs e)

  at System.Windows.Forms.UserControl.OnLoad(EventArgs e)

  at System.Windows.Forms.UserControl.OnCreateControl()

  at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

  at System.Windows.Forms.Control.CreateControl()

  at System.Windows.Forms.Control.WmShowWindow(Message& m)

  at System.Windows.Forms.Control.WndProc(Message& m)

  at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

  at System.Windows.Forms.ContainerControl.WndProc(Message& m)

  at System.Windows.Forms.UserControl.WndProc(Message& m)

  at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

  at System.Windows.Forms.Control.ActiveXImpl.System.Windows.Forms.IWindowTarget.OnMessage(Message& m)

  at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************

mscorlib

   Assembly Version: 2.0.0.0

   Win32 Version: 2.0.50727.42 (RTM.050727-4200)

   CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

----------------------------------------

System

   Assembly Version: 2.0.0.0

   Win32 Version: 2.0.50727.42 (RTM.050727-4200)

   CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

----------------------------------------

WinControls

   Assembly Version: 1.0.2894.26918

   Win32 Version: n/a

   CodeBase: localhost/.../WinControls.dll

----------------------------------------

System.Windows.Forms

   Assembly Version: 2.0.0.0

   Win32 Version: 2.0.50727.42 (RTM.050727-4200)

   CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

----------------------------------------

System.Drawing

   Assembly Version: 2.0.0.0

   Win32 Version: 2.0.50727.42 (RTM.050727-4200)

   CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

----------------------------------------

Accessibility

   Assembly Version: 2.0.0.0

   Win32 Version: 2.0.50727.42 (RTM.050727-4200)

   CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll

----------------------------------------

Microsoft.mshtml

   Assembly Version: 7.0.3300.0

   Win32 Version: 7.0.3300.0

   CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll

----------------------------------------

************** JIT Debugging **************

To enable just-in-time (JIT) debugging, the .config file for this

application or computer (machine.config) must have the

jitDebugging value set in the system.windows.forms section.

The application must also be compiled with debugging

enabled.

For example:

<configuration>

   <system.windows.forms jitDebugging="true" />

</configuration>

When JIT debugging is enabled, any unhandled exception

will be sent to the JIT debugger registered on the computer

rather than be handled by this dialog box.

this is very important to me..

if you reply to me..i really proud you..

thanks in advance

# December 4, 2007 4:53 AM

spano said:

Hi Balu, it seems that when executing on the client, your control is being downloaded but not the referenced webcamlib assembly, isn't it? You can check by executing "gacutil /ldl" on the client machine and see if all needed assemblies are in the download cache.

Honestly, I haven't try the case where the control referencies another assembly that is not in the GAC. As an alternative you can try to install the webcamlib on the GAC on the client machine and see what happens.

# December 6, 2007 3:35 PM

Soledad Pano's Blog said:

Some months ago I posted about Hosting a Windows Form Control in a web page . I explained there how we

# December 6, 2007 8:28 PM

james morris said:

hi

is it possible to create an event in the winform control and capture it with javascript on the web page.

I just can't get it to work

hope you can help

cheers

james

# February 7, 2008 9:20 AM

Smith said:

I created user control which inturn calls Vncsharp.dll.

I am getting "could not load Vncsharp.dll" error.

I tried setting up full trust for the dll.But I get the same error.Is it possible to embed VncSharp.dll in a another user control?

thanks..

# February 22, 2008 1:40 PM

cnc said:

Has anyone figured out a way to debug the windows forms control code behind logic when its dll is only referenced in the aspx web page html object element and the dll is placed in the root of the aspx web page?

I have tried quite a lot of things and still have not successfully not gotten it to work.

The project I am working on has this scenario, with parameters being passed between the windows forms control and the aspx web page it in on.

cnc

# May 5, 2008 8:04 PM

Law said:

cnc, the best that I can come up with to debug the windows control while it was running is to place MessageBox.Show at places where I want to get info back.

# May 12, 2008 7:34 PM

caru said:

Hi Sole  this is very good sample for the hosting program.

can you tell me how to call the hosting page(like asp.net) event from hosted object(Windows Form Control) ?

# July 28, 2008 3:37 AM

Dantevios Exsavior said:

I would like to know how to include multiple libraries (.dll files) with my project. Do I make a cabinet file to do this? If so how do you deploy it.

I see a bunch of people saying "my control works fine here but not on my intranet or internet". This is most likely because of the nightmare known as "Code Access Security". You can read about it under the MSDN on "Windows Forms Security". It is a pain to debug any kind of technology like this. Best of luck to you all.

# July 29, 2008 2:22 PM

#Monkey said:

Hello Dear

I've read in some articles that this Security stuff hasn't to deal with framework configuration nor Code Access Security. As i know the client just has to "trust" the website you are connecting to.

Since this is "ActiveX"...

# July 30, 2008 2:36 AM

Harry said:

Hi,

Nice artical for hosting windows control in web page.

But suppose if i have multiple frameworks installed on the client system say 1.1, 2.0  etc.

My control is created using framework 1.1 and is not compatible with 2.0 and onwards.

So when i try to access my control on client system, control is getting invoked under framework 2.0.

So any idea, how can we control this.

Regards,

Harry

# September 2, 2008 1:07 AM

som said:

i m getting javascript error for the above code 'object doesn't support this property or method'

# September 5, 2008 6:15 AM

santhosh said:

Hello master,

I am getting the same error as manu got ,

that i have pasted below,the thing is i have included a openfile dialogue in my usercontrol on click of a button , i am able to access the openfile dialogue on click of a button and i can select a files but in that dialogue on click of open i am getting the below error .. please guide me on how to resolve this

thanks in advance,

santhosh

See the end of this message for details on invoking

just-in-time (JIT) debugging instead of this dialog box.

************** Exception Text **************

System.IO.FileNotFoundException: Could not load file or assembly 'WebCamLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.

File name: 'WebCamLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'

 at WinControls.WinTreeview.WinTreeview_Load(Object sender, EventArgs e)

 at System.Windows.Forms.UserControl.OnLoad(EventArgs e)

 at System.Windows.Forms.UserControl.OnCreateControl()

 at System.Windows.Forms.Control.CreateControl(Boolean fIgnoreVisible)

 at System.Windows.Forms.Control.CreateControl()

 at System.Windows.Forms.Control.WmShowWindow(Message& m)

 at System.Windows.Forms.Control.WndProc(Message& m)

 at System.Windows.Forms.ScrollableControl.WndProc(Message& m)

 at System.Windows.Forms.ContainerControl.WndProc(Message& m)

 at System.Windows.Forms.UserControl.WndProc(Message& m)

 at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)

 at System.Windows.Forms.Control.ActiveXImpl.System.Windows.Forms.IWindowTarget.OnMessage(Message& m)

 at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)

 at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)

************** Loaded Assemblies **************

mscorlib

  Assembly Version: 2.0.0.0

  Win32 Version: 2.0.50727.42 (RTM.050727-4200)

  CodeBase: file:///C:/WINDOWS/Microsoft.NET/Framework/v2.0.50727/mscorlib.dll

----------------------------------------

System

  Assembly Version: 2.0.0.0

  Win32 Version: 2.0.50727.42 (RTM.050727-4200)

  CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System/2.0.0.0__b77a5c561934e089/System.dll

----------------------------------------

WinControls

  Assembly Version: 1.0.2894.26918

  Win32 Version: n/a

  CodeBase: localhost/.../WinControls.dll

----------------------------------------

System.Windows.Forms

  Assembly Version: 2.0.0.0

  Win32 Version: 2.0.50727.42 (RTM.050727-4200)

  CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Windows.Forms/2.0.0.0__b77a5c561934e089/System.Windows.Forms.dll

----------------------------------------

System.Drawing

  Assembly Version: 2.0.0.0

  Win32 Version: 2.0.50727.42 (RTM.050727-4200)

  CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/System.Drawing/2.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll

----------------------------------------

Accessibility

  Assembly Version: 2.0.0.0

  Win32 Version: 2.0.50727.42 (RTM.050727-4200)

  CodeBase: file:///C:/WINDOWS/assembly/GAC_MSIL/Accessibility/2.0.0.0__b03f5f7f11d50a3a/Accessibility.dll

----------------------------------------

Microsoft.mshtml

  Assembly Version: 7.0.3300.0

  Win32 Version: 7.0.3300.0

  CodeBase: file:///C:/WINDOWS/assembly/GAC/Microsoft.mshtml/7.0.3300.0__b03f5f7f11d50a3a/Microsoft.mshtml.dll

----------------------------------------

************** JIT Debugging **************

To enable just-in-time (JIT) debugging, the .config file for this

application or computer (machine.config) must have the

jitDebugging value set in the system.windows.forms section.

The application must also be compiled with debugging

enabled.

For example:

<configuration>

  <system.windows.forms jitDebugging="true" />

</configuration>

# September 12, 2008 11:42 AM

Srinath N said:

Hi,

I've created simple user contol using .NET 2.0 and included in ASP.NET 2.0 page it works fine while i'am accessing the web page from localhost and even from other client systems making my system as server.

I'am using Windows XP and IIS 5.1.

Now the problem is I hosted the control in a testing server with is Windows 2003 server and IIS 6.0. The control is not displaying. Contorl is showing up as disabled multiline text box.

I've added url into all code, full trust permission in .net configuration tool and I've also tried adding the servers url in trusted site in IE. Still does't work. It even doesn't work if I access webpage from server with localhost url.

can some body help me out where i'am going wrong.

thanks,

Srinath N

# October 1, 2008 3:52 PM

Jerry Z said:

I have created a simple Windows Control Lib, and put it in a web page. It works OK. But, when I modified the Lib dll, the web page can't display the control any more. Any one know the solution?

Thanks

# October 16, 2008 6:11 PM

Mike P said:

For Jeffery Z's I think you would need to do GACUTIL /cdl

My problem is that the control displays for IT users with elevated permissions but not for our normal users.

# October 22, 2008 6:59 AM

Eric Ouellet said:

Hello, I will repeat the Caru question because I have the exact same thought...

Hi Sole  this is very good sample for the hosting

program.

can you tell me how to call the hosting page(like asp.net) event from hosted object(Windows Form Control) ?

Thanks

Eric Ouellet

# October 27, 2008 10:51 AM

nilaangel78 said:

Hi,

It's working fine for me. But i tried with another example. After login form i want to show an MDI form in IE. Is it possible & how to do it. Because for me if click the login button, the MDI form comes seperate window.

# December 29, 2008 2:24 AM

arruix2001 said:

Hi all, I have one problem, When I do my Windows User Control I need  add one external DLL for display some medical image, compile my project and genereted the dll, so, This dll export to my Web Application and creat with tag

<object classid="http:WindowsFormsControlLibrary1.dll#WindowsFormsControlLibrary1.UserControl1" height="900px" width="800px">            

</object>

but this object not show in my IE, I guess that is for the DLL external, but i do not know include this dll, any idea for this problem??

In my cache only download WindowsFormsControlLibrary1.dll,Please help me Im going crazy for this!!!!

Regards

Sorry with my english

# January 16, 2009 11:41 AM

Manoj said:

Hi,

I bulit a new Class Library project and got a DLL. I also added app.config file in the class library project.

Now i am calling this DLL in the web application. Everything is working fine. But now i want to read the appName.exe.config file for connection string using the DLL.

Any idea will be more helpfull as i need it very urgently.

# January 29, 2009 10:48 PM

blurboy said:

Thanks for the information to clear the download cache!

I have another question.. How can I host a 3rd party Windows Form Control in a web page? I added the reference onto the web page but it doesn't work.

Any ideas?

Thanks in advance.

# March 23, 2009 6:34 AM

Ravi Ranjan said:

hi

I use this concept than we use for simpal work ,no any problem ,but when i handle Sqlserver so it generate error

please help me

# May 2, 2009 3:52 AM

spano said:

Hi Ravi, remember that the control runs on the client side, so you can't access the SqlServer on the server side.

# May 2, 2009 10:37 AM

web hosting nigeria said:

Its good to know these. but in truly practical terms, its of little value especially since dot net framework has to be installed in client machine.

# May 19, 2009 12:45 PM

Habib Ahmed Bhutto said:

hi guys,

I have cofusion abt this, that is the code executed on Client Machine ? Or it will be executed on Server Mahine???

Plz Response

Thanks in advance... ! :)

Regards,

Habib Ahmed Bhutto

# May 27, 2009 8:15 AM

spano said:

On the client.

# May 27, 2009 9:00 AM

Habib Ahmed Bhutto said:

That's  great... ! :)

Actually I m trying to execute some programs on Client Machine that are Pre-installed. Those programs are data collector and bar code readers, so I want to load them when my page is loading in browser. I have got my it through a vb script code but it is restricted due to security settings. And Each time user have to allow this or he/she has to set his/her browser settings. So my customer demands that it must be automated.

Now I m searching for a perfect Solution. If u have any Idea regarding to this, kindly share it... !

Can we do that we develop a control library and we write a function in that library for executing programs using shell32.dll (Open() function). And finaly we use that function to execute a program on client machine???

Plzzzz

I will be thankful to u for this act of kindness :)

Regards,

Habib Ahmed Bhutto

# May 28, 2009 1:33 AM

Habib Ahmed Bhutto said:

Hi spano

when click on "Send MEssage" button following error ocured in the browser.. ! :(

Plzzzzz Help me

////////////////////////////////////////////////////

////////////ERROR DETAIL////////////////////////////

////////////////////////////////////////////////////

Webpage error details

User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0; .NET CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.4506.2152; .NET CLR 3.5.30729)

Timestamp: Thu, 28 May 2009 07:18:38 UTC

Message: Object doesn't support this property or method

Line: 9

Char: 6

Code: 0

URI: localhost/WinControlTest

Message: Object doesn't support this property or method

Line: 9

Char: 6

Code: 0

URI: localhost/WinControlTest

# May 28, 2009 2:21 AM

Habib Ahmed Bhutto said:

Solved... !

Actualy that was due my mistake... ! ;)

# May 28, 2009 5:24 AM
Leave a Comment

(required) 

(required) 

(optional)

(required)