I need to execute .NET code on the client side. What is the best way to do this?
(I would say ActiveX, but that's not longer available under .NET right?)
Thank you for all help in advance.
Printable View
I need to execute .NET code on the client side. What is the best way to do this?
(I would say ActiveX, but that's not longer available under .NET right?)
Thank you for all help in advance.
What do you mean by executing .NET code on client side? It's a server side technology.
well just like I said it.
I wrote a piece of .NET code that I want to be executed on the client side.
Yes in the first place .NET is a server side technology. But if I have a program on the client side it should be possible to access it (perhaps after a security warning). Does anybody know how?
.Net code wont run on client side. You can only use JavaScript or VBScript on client side, though VBScript will only work on IE. So JavaScript is your best option. What exactly are you trying to do? Why do you need to run .Net code in Client side? What exactly is the .Net code doing?Quote:
Originally Posted by BramVandenbon
Maybe he'd like a COM wrapper for his .NET component so that it appears to be an ActiveX component.
I don't even know if this is possible. Anyone?
Javascript and VB are out of question, because those are simple web-languages.
Hmm :( too bad. I feel you probably all know just as much as I do. (but if it was a simple issue I wouldn't go to a forum lol)
Here goes the whole story:
I am making a website for a customer. The website allows the user to send a mailing with attachements to a large number of people.
So far it's simple. But the problem is that the user wants that the website opens outlook. Then the user can click send there and the message is stored in outlook outbox.
To do this I assume I should use the .NET Outlook Reference. But ofcourse under normal conditions you can't execute .NET code on the client side. All .NET code is only executed at the server side. So as far as I know I need something like ActiveX or Java (a compiled component that asks permission and runs on the client side).
What is it I need? *think people* ;-) it's really important
Thank you so far for your attempts but I need more :)
Well first of all its not a good way to send email through outlook, you can use severside code to email with attachment(CDONTS/ASPMail/.NEt builtin emailing function). Using outlook will mean that only user who have outlook can do this. Anyhow I can go on about the disadvantage of using outlook instead of a serverside component.Quote:
Javascript and VB are out of question, because those are simple web-languages.
Hmm :( too bad. I feel you probably all know just as much as I do. (but if it was a simple issue I wouldn't go to a forum lol)
Here goes the whole story:
I am making a website for a customer. The website allows the user to send a mailing with attachements to a large number of people.
So far it's simple. But the problem is that the user wants that the website opens outlook. Then the user can click send there and the message is stored in outlook outbox.
To do this I assume I should use the .NET Outlook Reference. But ofcourse under normal conditions you can't execute .NET code on the client side. All .NET code is only executed at the server side. So as far as I know I need something like ActiveX or Java (a compiled component that asks permission and runs on the client side).
What is it I need? *think people* ;-) it's really important
Thank you so far for your attempts but I need more :)
In the past you could use WScript Shell object (VBScript/JavaScript) to launch application from web page, but due to some security abuse it has been disabled. Your best option is ActiveX, place that on your html page and use that to open outlook. Note that if you use ActiveX then it will only work with IE and Users will need to allow or it wont run depending on their security level.
I would strongly suggest you consider not using Outlook, is it a Client requirement?
And finally no problem is too simple or too complex, a question which seems very complex to you might be trivial to some one else and vice versa, thats why we post here...
Yes, at the office we have the exact same discussion going on. And I totally agree with you on all those fields. But the customer wants Outlook really bad.
Indeed it would be really easy to do it from serverside, and I wouldn't be posting here if that was the case :).
ActiveX you say, can I access outlook from ActiveX ? (Is there a classlibrary I can access ?) Or should I use ActiveX to start an application that is allready installed ?
If you write the ActiveX in VB6 then you can reference the "Microsoft Outlook Object Library". This will allow you to access all elements of Outlook.Quote:
Originally Posted by BramVandenbon
Depends really what you want to do, if you simply want to fire up Outlook then all you need to do is use Shell or ShellExecute API.
Again due to viruses using this technique to spread themselve, Outlook will warn the user if you are trying to send email through Code(ActiveX). The email will only go through if user allows it.
If you want example then search this fourm, there are many examples.
sounds cool :)
Then I should probably reinstall VB6.
I also found the following: http://msdn.microsoft.com/library/de...ualBasic70.asp
Allthough I'm not sure if I get it 100%:Quote:
Visual Basic 6.0 ActiveX documents are not supported in Visual Basic .NET. You can still interoperate with ActiveX documents from your Visual Basic .NET Web applications, but development should be maintained in Visual Basic 6.0.
Visual Basic .NET also allows you to create ActiveX controls that can be downloaded to Web pages, or to use existing ActiveX controls in your Visual Basic .NET applications
1) ActiveX Documents are not supported in .NET
2) you can still interoperate with them in .NET
3) development should be maintained in 6.0
4) .NET allows you to create ActiveX controls.
5) .NET can use existing ActiveX controls.
lol :) I guess there is a difference between ActiveX controls and documents. Maybe a control is the compiled ocx-version while a document is the source.
And on the other hand it looks like I can not do this in C#.NET but only in VB.NET is that correct ? (that's pretty crappy if it's true, especially because I only have C# installed at the moment.) (I took a look in the create new project window and couldn't find "ActiveX")
So I guess I need to install VB.NET or reinstall VB6? *sigh*
Quote:
Originally Posted by BramVandenbon
Well i dont know what is ActiveX document, by activeX i usually mean a .exe or dll file. I have never used .net to write ActiveX, i dont even know if thats possible since the whole idea of .net is to move away from COM and ActiveX. I guess VB.Net might have it for bacword compitability. I have rarely used VB.Net so I wouldnt know, like you I only have C# instaled.
I personally never used an ActiveX control on a web page, but if I need it then I would write it in VB6.
hi i hope its not late to help i noticed that this was posted last april anyway...we cannot create an activex in .net but we can create a dll and we can embed it on a web page...
Please see the attached zip file
it's consist of a html and the project with win user control...
you can also use ordinary class and build it as dll
you have to remember to put these on the class
VB Code:
Namespace TrialControl Public Interface MyControl Property Username() As String End Interface End Namespace
Well if Outlook is the default mail client, what's wrong with just using a regular mailto link? I.E.
Because my customer wants a lot more than just that. He also wants the possibility to add attachements for example.Quote:
Originally Posted by TomGibbons
It used to be possible to use activex components. Those act like programs that run on the client side. But they are still integrated in the webbrowser itself (simular to a java applet). The big advantage is, that it has full control of the client ! (Ofcourse when the viewer visits such kind of website he first has to click "yes" on some kind of security dialog message.)
The problem is: ActiveX was a VB6 thing. And I think it does not longer exist under .NET.
Jewel, your post looks promising. I'll take a look at it as soon as I'm at work. :-) thanks in advance
1) .NET does NOT create ActiveX components of any kind.
2) It is VERY DANGEROUS to use ActiveX on websites... it means the user will have to install the component before they can use it's funcitonality.
3) Not every browser supports ActiveX
4) Please let me know what site this is for so that I make sure I never visit.
5) Microsoft never really supported ActiveX Documents, it was a mistake (They'll even tell you as much) that got out when it shouldn't have
6) There are three types of ActiveX objects: exe, dll and ocx.
7) ActiveX was more than just a VB6 "thing" -- it was more of a COM "thing"
8) If you want to send mail, the "best" way (and this is purely subjective) is to use server side components to do so, and if they want the customer to also have a copy, then you simply add the customer's email as a CC (courtesy copy) to the email. Then everyone has a copy.
9) Not everyone uses Outlook, let alone have it installed.
10) Some people have their security settings cranked up so high, that not even signed ActiveX components can be installed.
I would raise some of these with your client as they are serious barriers to their customers. And (in my opinion) I believe them to be serious enough that it could reduce significantly the number of potential sales.
Tg
Hosting a DLL in an object as jewel suggests's works well, BUT there's a few thing you need to know. The client MUST have .net framework installed (this also limits you to windows clients). As it's not running on the local machine it'll be running in secure mode (unless the set it as a trusted assembly) so you can't do a lot of things like access the HD.
hey tpm thanks for the info, i actually have a question about it, in the sample, the dll has to be on the same directory where the webpage is at, would you happen to know if there's a way to have the component on the client and reference that from the web page? makes sense?
hmmm....
thanks,
jewel
Hmm well you set the dll's location in the classid parameter, so you may be able to set a local dir... Even if that worked it's probably not a good idea though, for a couple of reasons. The client would need to download the dll and put it in the correct location, this be a problem for people with restricted accounts that can't access say the C drive and also idiots who don't even know what a C drive IS.... Your also straight out giving the user a copy of your dll which isn't exactly desirable.
yeah..but the component that I bought requires client side distribution :( for royalty free fee...
Well unless it either does something amazing or you know the people that are going to be using it (like a company portal etc) the number of people that have windows/.net and are willing to download the dll are going to be minimal. Your probably better off remaking it using the component you bought as a template.
Oh BTW you can also set runtime properties by using <param name="" value=""> within the object
... Mentioned only 10 times before in this topic.Quote:
Originally Posted by techgnome
This isn't really of any importance at all. I am trying to run code on client side. Ofcourse it's a dangerous technology !!!Quote:
Originally Posted by techgnome
But even if it was of any importance, don't you think that my customer can trust his own server ??? Believe me, he's not going to hack himself.
Doesn't matter. Then we'll use the right browser!Quote:
Originally Posted by techgnome
I see you are a macintosh or linux user? That kind that says it's all bad and wrong. *sigh* BTW... it's not even a public website.Quote:
Originally Posted by techgnome
I never said it was the best way. And I never said anything like it's only VB6. And what about those types. So what, what's your point? And that doesn't even matter at all. That's totally offtopic. :eek2:Quote:
Originally Posted by techgnome
But thank you for your help. ;)
Well in that case tell them that they cannot have it.Quote:
Originally Posted by BramVandenbon
Remember, you are not a code monkey, you have a job for a reason. You can tell the customer what is, and is not, acceptable.
There are some things that developers really should stand up for themselves, put their foot down, and say "No, I'm sorry, but that's not possible."
Why do they want outlook so bad? I bet it's for a really stupid reason, because someones dogs, sisters, owners, grandads, goldfish once told them that if you didn't use outlook then you will catch leg rot from a blue toad when the moon is fat...or something like that.
The customer is not always right, and it's your job to tell them they are wrong, and suggest alternative, and better, methods to achieve the same thing.
WOkja
I am asking for a way to solve a problem, not for several reasons not to do it at all. (Also it's not the number of posts that counts, the quality is more important by far.)Quote:
Originally Posted by Wokawidget
And I am also not looking for a way to "approuch my customers". If that is the case you will find me posting a message in a marketing-forum.
Please stick to the field of programming. Because posts like this are a waste of your and my time.
(On top of that, with all my respect but imho it shows a lack of spirit. It is like saying: "I am not experienced enough to solve your problem. Sooooo, give it up!". A terrible thing to say! It's not because some single person gives up that I should give up as well. It seems like that certain person does think very high of himself, claiming he is more experienced than all other programmers of the forum together. I am sure you don't want to give an impression like that! ==> Personally I would never post a message like that. Remember it's better to ... than to ... and remove all doubt. :))
Hey BramVandenbon, we are trying to help you. You are asking to do something which can only be done in VB6 using .NET and a technology which is unsafe and has been put in the garbage by M$.
Not only that you also say the following:
Do you realise how much traffic will be generated on the network when sending an email to a large number of people containing attachments and that although the customer may be sending only one email, the mail server must make an individual copy for each recipient?Quote:
I am making a website for a customer. The website allows the user to send a mailing with attachments to a large number of people.
Seen as you want all this done on the client, why not write a program, use the web page to host it and ask the clients to download an execute it, because that is in effect what you are doing.
You can then have the program contact the server and get all the attachments and open Outlook.
[edit]On second thought... I'm not going to stoop to that level. <snip>removing knee-jerk reation post</snip>[/edit]Quote:
Originally Posted by BramVandenbon
[apology]To anyone that might have seen the original post in the last couple of minutes, my apologies. I should know better[/apology]
Tg
ps: Next time you giv neg rep, have the guts to sign your name.
BramVandenbon, these people are trying to help you. If you feel discouraged because they are giving you suggestions that may point in directions other than the one you are trying for, then I understand your frustrations. You MUST realize none the less that they are in fact trying to get you to the "RESOLVED" point.
PS.. did you know that .NET exes can actually run right from the internet on a client PC??? it is all a matter of permissions... you may be able to use a standard .net exe to do what you are looking to do, but will need to require users of this "site" set permissions accordingly for .NET framework. Often times this can be a task that is not worth the effort, as users are generally not good at tinkering with permissions. Its a way all the same though. If this is for a customer that will be using this as an INTRANET site, versus an INTERNET site, permissions are often much easier to get setup correctly.
You maybe able to use/rework this if you don't want to host a dll:
http://www.notestips.com/80256B3A007...E?OpenDocument
Let's call it resolved.
Thank you for all your help, people.
By the way, techngome:
- I said it as nice as I could. Sorry, if it sounded insulting. I had no intentions to reach something like that. I do appologize.
By the way, VisualAd:
- What do you mean by "VB6 using .NET" ? :ehh:
I think he meant create an ActiveX Control using VB6, then use ASP.NET to create your web site and put the ActiveX control into your web page.Quote:
Originally Posted by BramVandenbon
Woka