ActiveX controls and ASP.Net

W

Weston Fryatt

I have a custom written ActiveX Control (written in VC++ 7 unmanaged) that
is embedded on a web page, I need to be able to send events (like button
click and toolbar clicks) from the ActiveX Control (clients side) to ASP.Net
(server side)

Can this be done? If so any clues on what to search on?

Thanks,
Weston Fryatt
 
M

Mark Micallef

Hi Weston,

As your ActiveX control is running client-side in the browser, you're
crossing the client-server border with what you're trying to do, so this
becomes a complex issue.

It would help to understand what you're trying to achive, as (odd as
this may sound) I think you're going the wrong way about what you're doing.

The only reason you would have your ActiveX control communicate with IIS
(the asp.net application server) is to load a new page, so you would
change the browser's window.location.href attribute. Using this method,
you could pass information along the querystring. Bear in mind that your
ActiveX applet will get unloaded, and a new page will load. Even if it's
the same page you call, your applet will go through an uninit and init
events (basically, it gets restarted). This may or may not be what you
want, but it's quite a clunky way to do things.

Cheers,
Mark
 
W

Weston Fryatt

Thanks Mark...
It would help to understand what you're trying to achive, as (odd as this
may sound) I think you're going the wrong way about what you're doing.

I work in Document Imaging, and I have been tasked to write a highly custom
Image Viewer and Document Scanning control. So far I have the Image Viewer
part working, where I can send any image format (TIF, JPG, DICOM, and about
40 another image formats) from my server side and have it securitly
displayed in the viewr control. The next step is to do the reverse, To Scan
a Image and send it back to the server side??? But I just don't know how I
can pass the data back?

I have thought about a WebService, But I don't think that would work because
I wouldn't know one sessions data from the other??


Thanks again,
Weston Fryatt
 
G

Guest

But I just don't know how I
can pass the data back?

I have thought about a WebService, But I don't think that would work
because I wouldn't know one sessions data from the other??

Web services would work great in this situation. A web service is just a
function call - so to separate sessions you would need to tag the function
call with some information. Perhaps you could tag the information with the
current UserID? Or when your ActiveX control loads - maybe you can tag that
session with a GUID, and pass the GUID to the web service?
 
M

Mark Micallef

Hi Westdon,

That's an interesting design problem. Since you're definitely wanting to
send a big chunk of data back to the server, you may indeed want to do a
post back to the server after all. Perhaps one way to do this would be
to have a form with a small set of hidden input fields on your page.
When you're ready to post your scanned image back to the server, your
embedded control could uuencode (or base64) the image and put it into
one of the hidden fields. You can use other fields as needed for the
image's attributes (e.g. name, format, owner, whatever else you like to
store). Then post the form. On the server side, you would uudecode the
image and do what you want with it.

If you've already cosidered this option, I'd be interested in hearing
what problems you've run up against.

Cheers,
Mark
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,153
Members
46,699
Latest member
AnneRosen

Latest Threads

Top