473,657 Members | 2,435 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

RE: Handling ActiveX in ASP.net

Hello Philippe,

In addition to bruce's points, I'd suggest the KB article
http://support.microsoft.com/kb/317392. It demonstrates how to host an
ActiveX control in ASP.NET (for your first question), and points out that
ActiveX control is a pure client-side control, the server-side code cannot
access this control (for your second question). Server-side code can access
only server controls, which are the controls that are listed on the Web
Form tab in the toolbox. But do we have any workarounds to get/set ActiveX
control properties from the server-side code? Yes, we have.

A. To set an ActiveX control property from the serve side:
As bruce mentioned, we can render a script block to set the variables. For
example:
Response.Write( "<script>myCont rol1.myProperty ='aaa';</script>");
where "myControl1 " is the client-side ID of the ActiveX control.

B. To get an ActiveX control property from the server side:
Suppose that you want to get the ActiveX control's property in a asp.net
button Click postback, we can register a client-side onclick event for the
button:
<asp:Button runat=server ID='btn' OnClientClick=' clientSideClick Event'
OnClick='server SideClickEvent' ¡* />
In the clientSideClick Event javascript function, we get the ActiveX
control's property and place the value in a hidden field (e.g.
asp:HiddenField ). After then, we can get the property value from the
asp:HiddenField control in our server side OnClick call back.

Please let me know if you have any other concerns, or need anything else.

Regards,
Jialiang Ge (ji****@online. microsoft.com, remove 'online.')
Microsoft Online Community Support

Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
ms****@microsof t.com.

=============== =============== =============== =====
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
=============== =============== =============== =====
This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 27 '08 #1
1 1931
Hi Jianlang,
"Jialiang Ge [MSFT]" <ji****@online. microsoft.coma écrit dans le message
de news:Dr******** ******@TK2MSFTN GHUB02.phx.gbl. ..
Hello Philippe,

In addition to bruce's points, I'd suggest the KB article
http://support.microsoft.com/kb/317392. It demonstrates how to host an
ActiveX control in ASP.NET (for your first question), and points out that
ActiveX control is a pure client-side control, the server-side code cannot
access this control (for your second question). Server-side code can
access
only server controls, which are the controls that are listed on the Web
Form tab in the toolbox. But do we have any workarounds to get/set ActiveX
control properties from the server-side code? Yes, we have.

A. To set an ActiveX control property from the serve side:
As bruce mentioned, we can render a script block to set the variables. For
example:
Response.Write( "<script>myCont rol1.myProperty ='aaa';</script>");
where "myControl1 " is the client-side ID of the ActiveX control.

B. To get an ActiveX control property from the server side:
Suppose that you want to get the ActiveX control's property in a asp.net
button Click postback, we can register a client-side onclick event for the
button:
<asp:Button runat=server ID='btn' OnClientClick=' clientSideClick Event'
OnClick='server SideClickEvent' ¡* />
In the clientSideClick Event javascript function, we get the ActiveX
control's property and place the value in a hidden field (e.g.
asp:HiddenField ). After then, we can get the property value from the
asp:HiddenField control in our server side OnClick call back.

Please let me know if you have any other concerns, or need anything else.
This post is eally helpful to me.
Thank you very much

Jun 27 '08 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

13
7770
by: Patrick | last post by:
I understand that with IIS5.1 on Windows XP Professional SP1, I can 1) Either set under IIS Manager-> Any specific Virtual Directory-> Configuration->Options->ASP Script timeout for all pages within that directory OR 2) Within a specific page, set the timeout as per http://www.microsoft.com/windows2000/en/server/iis/default.asp?url=/windows2000/en/server/iis/htm/asp/vbob246s.htm e.g. <% Server.ScriptTimeout = 1 %> and that the value in...
3
19023
by: klimontovich | last post by:
Hello! I'm trying to handle events raising by Microsoft ActiveX Spreadsheet control. I use following code to include this control into page: <object classid="clsid:0002E551-0000-0000-C000-000000000046" id="Spreadsheet1""> </object>
2
4967
by: S.Kartikeyan | last post by:
Hello group, I have the follwing problem with microsoft web browser activex control. I have a fileopendialog control. I open different files in the IEActivex control based on the filename in the fileopendialog control. When i open ppt or doc or pdf files it is nice that it opens them in its window. THE PROBLEM NOW IS when ieactivex control is opening these different
2
5349
by: Bill | last post by:
I have a VB6 ActiveX EXE app that generates events that I would like to handle in a C# application. The events in the VB app are defined like: Public Event SometingHappened(what As String) and raised like so: Public Sub EventNotification(ByVal what As String) RaiseEvent SometingHappened(what)
1
2418
by: Felipe Garcia | last post by:
i have some old asp pages that uses activex controls. At the moment, my company are converting all of these old asp pages to asp.net. So my question is, there is a way to handle activex events in the asp.net code behind. <SCRIPT FOR="WEBDECODER1" EVENT="onaction" LANGUAGE="VBScript"> dim myaction dim sig, format, captureTime set myaction= action1 sig = myaction.Signature myform.submit </SCRIPT>
3
4922
by: J055 | last post by:
Hi How do I tell the user he has tried to upload a file which is too big... 1. when the httpRuntime.maxRequestLength has been exceeded and 2. when the uploaded file is under then httpRuntime.maxRequestLength For point 1. it would be good to at least display a nice error page. IE seems to just display a blank page.
0
1302
by: Itchy Ferret | last post by:
Yo I have exactly same problem as the below. Does anyone know a solution, pls? Thanks, Itchy. -------------------------------------------
1
1564
by: SeemaPal | last post by:
Hi friends I have a problem in my project with ActiveX control. i am using older version of spread control. it thrown an exception "InvalidActivexStateException accured in axinterop.fpspread.dll" at run time. Is it have any solution?
6
8043
by: hufaunder | last post by:
I have an ActiveX component that I want to use in a library that I am writing. As a first test I used the ActiveX component in a windows form application. Adding the component created: Ax.dll .dll I can not call the functions in the ActiveX component. In the next step I tried to use the ActiveX component in a class library. I simply added a reference to the corresponding COM component. This this only
0
8310
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8826
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8732
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8605
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7330
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6166
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4306
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2726
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
1615
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.