473,897 Members | 2,872 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 1946
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
7794
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
19046
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
4979
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
5362
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
2427
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
4941
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
1316
by: Itchy Ferret | last post by:
Yo I have exactly same problem as the below. Does anyone know a solution, pls? Thanks, Itchy. -------------------------------------------
1
1570
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
8088
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
9990
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9837
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
10850
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...
1
10941
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9656
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
8032
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
7185
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
6074
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3300
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.