About the application of the winform control in Asp.net.

Source: Internet
Author: User

Keywords: Asp.net 2.0, ie, winform, ocx, ActiveX,Control Interaction, DOTNETInteroperability, ComInteroperability

Running environment:. Net framework2.0,

Development Environment:Visual Studio 2005(Winform2.0, ASP. net2.0)

In many cases, we haveAsp.netEmbedded some desktop controls, suchWin32 ocx (ActiveX)Control,DOTNET winformControl. Here, we will briefly describe some problems encountered in the application.

1.OCXControl inAsp.net 1.xYou can drag it from the toolbarWebformUse on the page. During the design, the page can display a specific visual effect. AvailableJavascript.

2.OCXControl inAsp.net 2.0The following cannot be dragged from the toolbarWebform. The toolbar icon is unavailable in gray. Therefore, we must manually modifyHtmlView, embedded in itObjectElement, syntax andAsp.net 1.xSame. In this caseWebformThe page does not show the actual design effect of the control, but only shows a box, representingOCXWidget size.

3.SimpleWinformControl inAsp.net 1.x, Asp.net 2.0The following cannot be dragged from the toolbar.Webform. The toolbar icon is unavailable in gray. Therefore, we must manually modifyHtmlView, embedded in itObjectElement, syntax andAsp.net 1.xSame. In this caseWebformThe page does not show the actual design effect of the control, but only shows a box, representingOCXWidget size. Only when running can we see the real effect.

In this caseOCXInAsp.net 2.0.

The simple definition above is that the control only contains the basic(Built-in System) WinformControl, not includedWin32 OCXControl.

4.Complex controlsAsp.net 1.x, Asp.net 2.0None of the following can be used directly.CodeNo.

The simple definition above is that the control containsWin32 OCXControl.

5.ForAsp.netHybrid useWin32 OCXControls andDOTNET winformControl, a feasible approach is:

A)InWindowsIn the user controlOCXAttachWinform.Win32AndDOTNETInteractive operations are supported.

B)InAsp.netPlayingWinformUser Control packageAsp.net WebUser Control. InAsp.net 1.xInAsp.net 2.0Only code can be used.

C)SetAsp.netUse on the pageWebUser Control.

6.A problem not completely solved:WinformControl andJavascriptInteraction. Interaction refersWinformAndJavascriptMutual attribute and event calls. I have never succeeded as I said on the Internet.

7.If you have any questions or suggestions, I hope you will discuss them more.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.