Can ActiveX controls written by VC be referenced by ASP. NET?

Source: Internet
Author: User


1. Dear partner!
Thank you very much for using Microsoft news group technical support!
About the ASP. NET cannot reference VC-written controls. I would like to ask if you want to reference some functions of VC controls on the server side, or VC writes an ActiveX control and cannot be used on the webpage. Can you describe your current error in detail. Or the specific error message you encounter when referencing the VC control, so that we can better help you solve the problem, thank you!
2. as for the interaction between C # and ActiveX controls written by VC, you may want to know ASP.. NET Server Side how to communicate with ActiveX controls contained in the front-end page. If my understanding is incorrect, please point out.
Based on my experience, there is no way for the background program to communicate directly with the foreground ActiveX, because they are in two different mechanisms. First, ActiveX behaviors or events are all initiated on the client, but they do not have the ability to communicate with the server. C # ASP. NET completely belongs to a set of Web Application framework system, which corresponds to some requests of the client and then makes some specific response actions, but it does not have the ability to capture client events. Therefore, it is impossible to directly communicate ActiveX controls with ASP. NET Server applications.
Therefore, based on my experience, we can select two methods for implementation. First, we can write some hidden fields to store some information changed by ActiveX on the client. For example, in ActiveX controls, some geographic information may be changed from "Beijing" to "Shanghai ", at this time, we can use JavaScript to capture this event (the specific capture method depends on the specific implementation of the ActiveX control). At this time, we use JavaScript to modify the information of some hidden fields we set, and then the postback event is triggered by some server-side controls to pass these values to the server, then, the server stores the data in the database. Correspondingly, when the server segment reads some information from the database, and then some hidden fields of the client it presents, the ActiveX control then obtains the information from the field.
Another method is to write our own HttpListener, listen to the Http request, and then make a judgment. If it is an ActiveX request, the current ASP. NET application will be notified to respond to the request.

Related Article

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.