Xtreme Visual Basic Talk

Xtreme Visual Basic Talk (http://www.xtremevbtalk.com/)
-   ASP.Net (http://www.xtremevbtalk.com/asp-net/)
-   -   Custom Control (http://www.xtremevbtalk.com/asp-net/327430-custom-control.html)

holtzy 12-09-2014 09:18 AM

Custom Control
I have a custom drawing user control I've created in a windows form app that I need to enable use for in an asp.net application. It uses System.Drawing extensively. It also uses/imports another custom class. The control takes input from the user with the arrow keys, numbers, etc. It has many public properties and subs that I need to interact with using the server side code in my asp.net application.

I was hoping for some direction on how to proceed. Can I somehow just reference the dll? Can I convert it to an activeX control? I am hoping to avoid re-writing the control.

Thanks for any advice you can give.

PlausiblyDamp 12-09-2014 10:56 AM

You can create an ActiveX component in VB.Net - IIRC one of the items you can add to a VB project is a COM Class (another name for an ActiveX component) so this is certainly possible.

In reality this might be a lot more difficult and restrictive though, you would probably have no luck with any browser that wasn't Internet Explorer and even IE might not support this on all versions. If support does exist it might be blocked for security reasons anyway. Also be aware that if it does work then it is effectively running on the client browser and will not have any direct access to server side functionality and neither will server have any direct access to this component.

Out of interest what does this component do? There might be a better and more web friendly way of achieving you aims.

holtzy 12-09-2014 11:04 AM

It is a floor layout tool where you can draw rectangles one line at a time, arcs, angles, etc. It runs various calculations along the way.

I have to keep the code server side for security reasons, so I am limited on what I can send to the client. I'm concerned that if I turn this into a com component, I won't get the interaction I need between the client/server.

PlausiblyDamp 12-10-2014 09:54 AM

Unfortunately I can't think of an easy way of just taking that component and making it work in such way it can communicate with server side code, not without an awful lot of effort and re-engineering anyway.

One possibility might be to rewrite it as a Silverlight app, although Silverlight itself is a bit of a dead technology and would involve a lot of work anyway.

Another possibility is to write the client portion in Javascript and have it communicate with the server using a standard mechanism (e.g. WebAPI). This is also going to be a lot of work though.

Do you have any particular client side requirements? e.g. do you know if the client will have a specific browser installed?

holtzy 12-10-2014 10:37 AM

I can dictate what browser the client uses at least. I'm not sure I'm proficient enough in JavaScript to write something this complex. However, it doesn't sound like I have much of a choice since it has to communicate from the client side.

All times are GMT -6. The time now is 01:47 AM.

Powered by vBulletin® Version 3.8.9
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Search Engine Optimisation provided by DragonByte SEO v2.0.15 (Lite) - vBulletin Mods & Addons Copyright © 2018 DragonByte Technologies Ltd.
All site content is protected by the Digital Millenium Act of 1998. Copyright©2001-2011 MAS Media Inc. and Extreme Visual Basic Forum. All rights reserved.
You may not copy or reproduce any portion of this site without written consent.