Monday, March 12, 2012

Windows Forms controls

If I used a Windows Forms control on my web application would the .net framework be required on client machines ?
I am of course assuming that all client machines on the intranet have Windows installed.
Yes you do. Bummer but I should have known that.
TIAI don't believe you can use Windows form controls in a web application. Web controls simply create HTML (sometimes with JavaScript) for the client so the users of the Intranet do not need the .NET framework installed or even Windows - the Web application simply renders as an HTML page so a web browser is the only required software.

Which Windows controls do you want to use - in a lot of cases web controls exist that work the same way.

DJ
They can be used on a web page, but it's a not-so-common paradigm of programming today when compared to ActiveX on web pages. The technique is pretty much similar, except that you have to include the namespace in the object tag and also ensure that the .NET framework exists on the end-user's machine.
venerable bede - ignore my post I'm obviously talking out of me arse.

mendhak - I've never heard of this method - could you provide any links to examples? Have you used this in the past or do you stick to web controls? Obviously this method isn't good for general web pages but I can see the possible advantages for an Intranet.

DJ
Read this:
http://www.15seconds.com/issue/030610.htm
http://steveorr.net/articles/WinformControls.aspx

I've never used this, nor will I ever use it. Despite the advantages that the articles may list out, I think it's a bad idea, as bad as ActiveX, and as obvious from venerable bede's post, full of problems. ;)
Ah right - not surprised I haven't heard of it looks nasty to me. Run away!

DJ
Run away!

OK. :(

Windows forms controls in WebForms

Hi,
We are placing Windows Controls inside webforms for a project that needs to
interact with files from a local computer.
What would be the best way to make the following work:
When a user clicks on a WebGrid Item (from Infragistics NetAdvantage
actually), we need to automatically compare the WebServer File with the
user's Local File.
Is it possible to pass data from a webcontrol to a windows control through
Javascript or something like that.
Gusyup, it's possible but you get into CAS permissions and deployment issues
that you need to be aware of. Write the application as a windows forms
first. Getting working correctly and then embed it in the web page. I have a
few articles on that sort of thing on msdn that you can look at:
http://support.microsoft.com/kb/555687
http://support.microsoft.com/kb/555685
http://support.microsoft.com/kb/555688
Regards,
Alvin Bruney
---
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
"Gustavo" <1@.1.com> wrote in message
news:epjD2HZOHHA.320@.TK2MSFTNGP06.phx.gbl...
> Hi,
> We are placing Windows Controls inside webforms for a project that needs
> to interact with files from a local computer.
> What would be the best way to make the following work:
> When a user clicks on a WebGrid Item (from Infragistics NetAdvantage
> actually), we need to automatically compare the WebServer File with the
> user's Local File.
> Is it possible to pass data from a webcontrol to a windows control through
> Javascript or something like that.
> Gus
>

Windows forms controls in WebForms

Hi,
We are placing Windows Controls inside webforms for a project that needs to
interact with files from a local computer.

What would be the best way to make the following work:

When a user clicks on a WebGrid Item (from Infragistics NetAdvantage
actually), we need to automatically compare the WebServer File with the
user's Local File.

Is it possible to pass data from a webcontrol to a windows control through
Javascript or something like that.

Gusyup, it's possible but you get into CAS permissions and deployment issues
that you need to be aware of. Write the application as a windows forms
first. Getting working correctly and then embed it in the web page. I have a
few articles on that sort of thing on msdn that you can look at:

http://support.microsoft.com/kb/555687
http://support.microsoft.com/kb/555685
http://support.microsoft.com/kb/555688
--
Regards,
Alvin Bruney
----------------
Shameless author plug
Excel Services for .NET is coming...
OWC Black book on Amazon and
www.lulu.com/owc
"Gustavo" <1@.1.comwrote in message
news:epjD2HZOHHA.320@.TK2MSFTNGP06.phx.gbl...

Quote:

Originally Posted by

Hi,
We are placing Windows Controls inside webforms for a project that needs
to interact with files from a local computer.
>
What would be the best way to make the following work:
>
When a user clicks on a WebGrid Item (from Infragistics NetAdvantage
actually), we need to automatically compare the WebServer File with the
user's Local File.
>
Is it possible to pass data from a webcontrol to a windows control through
Javascript or something like that.
>
Gus
>

Windows forms controls in explorer part 2

As some of you may be aware you can embed a windows forms control in ie using the <Object> tag. You can also alter properties of a control client side from the webpage using javascript.

What I want to know is :

Can 2 windows controls on a page raise/respond to eachothers events client side ?

OR

Can 2 windows controls on a page raise/respond to eachothers events server side ?As some of you may be aware you can embed a windows forms control in ie using the <Object> tag.

I was not aware of that, do you have code? Are the webpages IE only?

Windows Forms in a WebForm

Has anyone been able to get a WinForm to work embedded in a Web form yet?
I've tried a sample, and even created my own test, from one of the rare
articles from MSDN, but they do not work, not even the sample from the
article works. If anyone wants to check out the sample code and article,
here is the URL: http://msdn.microsoft.com/msdnmag/i...2/01/userctrl/.
Thanks,
Jason WalravenHi,
Yes I successfully embedded two user controls in web applications,
including firing events to IE. Basically it's very close to smart
clients, we just download DLL instead of EXE. Those two articles help
me:
KB - 313891 - http://support.microsoft.com/?kbid=313891
and
Chris Sells Security and versioning models in the windows forms engine
help you create and deploy smart clients. -
http://msdn.microsoft.com/msdnmag/i...ients/default.a
spx.
Natty Gur[MVP]
blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377
*** Sent via Developersdex http://www.examnotes.net ***
Don't just participate in USENET...get rewarded for it!

Windows Forms in a WebForm

Has anyone been able to get a WinForm to work embedded in a Web form yet?
I've tried a sample, and even created my own test, from one of the rare
articles from MSDN, but they do not work, not even the sample from the
article works. If anyone wants to check out the sample code and article,
here is the URL: http://msdn.microsoft.com/msdnmag/i...02/01/userctrl/.

Thanks,
Jason WalravenHi,

Yes I successfully embedded two user controls in web applications,
including firing events to IE. Basically it's very close to smart
clients, we just download DLL instead of EXE. Those two articles help
me:

KB - 313891 - http://support.microsoft.com/?kbid=313891

and

Chris Sells Security and versioning models in the windows forms engine
help you create and deploy smart clients. -
http://msdn.microsoft.com/msdnmag/i...ients/default.a
spx.

Natty Gur[MVP]

blog : http://weblogs.asp.net/ngur
Mobile: +972-(0)58-888377

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!

Windows Forms In Internet Explorer

Hi folks,
I'm embedding a Windows Forms User Control into an aspx web page. I've
created the class library in C# and added the user control to it.
If the control just has simple Windows Forms Controls (like TextBoxes or
Buttons), it works fine. IE treats it wonderfully
If I do something a little more advanced though (like connecting to the
Outlook Object Model in code, or embedding the Web Browser Control...), then
it doesn't work. It will work while debugging through Visual Studio, but if
I open the site outside of Visual Studio, then it just gives me a blank box
where the control should be.
Is there anyway to overcome this? This is for a local intranet, so I can
have changes made to the local security policy of the client PCs if
neccessary. Right now though, I'm not sure what the solution is. Do You?
Thanks!Woops...Sorry take that back. The first few times I went to that site, that
is what I got, but then eventually it started displaying. I guess it was
still downloading or something.
Not sure how to overcome that either...but at least it's working for now.
"John Smith" <m@.ty.com> wrote in message
news:e4Yq1eivFHA.3236@.TK2MSFTNGP14.phx.gbl...
> Hi folks,
> I'm embedding a Windows Forms User Control into an aspx web page. I've
> created the class library in C# and added the user control to it.
> If the control just has simple Windows Forms Controls (like TextBoxes or
> Buttons), it works fine. IE treats it wonderfully
> If I do something a little more advanced though (like connecting to the
> Outlook Object Model in code, or embedding the Web Browser Control...),
then
> it doesn't work. It will work while debugging through Visual Studio, but
if
> I open the site outside of Visual Studio, then it just gives me a blank
box
> where the control should be.
> Is there anyway to overcome this? This is for a local intranet, so I can
> have changes made to the local security policy of the client PCs if
> neccessary. Right now though, I'm not sure what the solution is. Do You?
> Thanks!
>
There are a lot of security restrictions when using windows forms controls i
n
a webform. That is almost certainly your problem.
Here's more info:
http://www.aspnetpro.com/features/2...p200509so_f.asp
http://www.15seconds.com/issue/030610.htm
I hope this helps,
Steve C. Orr
MCSD, MVP
http://Steve.Orr.net
"John Smith" wrote:

> Hi folks,
> I'm embedding a Windows Forms User Control into an aspx web page. I've
> created the class library in C# and added the user control to it.
> If the control just has simple Windows Forms Controls (like TextBoxes or
> Buttons), it works fine. IE treats it wonderfully
> If I do something a little more advanced though (like connecting to the
> Outlook Object Model in code, or embedding the Web Browser Control...), th
en
> it doesn't work. It will work while debugging through Visual Studio, but
if
> I open the site outside of Visual Studio, then it just gives me a blank bo
x
> where the control should be.
> Is there anyway to overcome this? This is for a local intranet, so I can
> have changes made to the local security policy of the client PCs if
> neccessary. Right now though, I'm not sure what the solution is. Do You?
> Thanks!
>
>
a couple issues:
1) .net code hosted by IE runs in a security sandbox. to access outlook (or
call unmanged code like a com object), the users must mark your assembly
trusted (see caspol.exe).
2) it takes a while for IE to spinup a windows forms user control, it must
load the .net vm, jit the control, etc . this can take up to minute or two
depending on the assembly.
3) the user must have .net framework installed
-- bruce (sqlwork.com)
"John Smith" <m@.ty.com> wrote in message
news:e4Yq1eivFHA.3236@.TK2MSFTNGP14.phx.gbl...
> Hi folks,
> I'm embedding a Windows Forms User Control into an aspx web page. I've
> created the class library in C# and added the user control to it.
> If the control just has simple Windows Forms Controls (like TextBoxes or
> Buttons), it works fine. IE treats it wonderfully
> If I do something a little more advanced though (like connecting to the
> Outlook Object Model in code, or embedding the Web Browser Control...),
> then
> it doesn't work. It will work while debugging through Visual Studio, but
> if
> I open the site outside of Visual Studio, then it just gives me a blank
> box
> where the control should be.
> Is there anyway to overcome this? This is for a local intranet, so I can
> have changes made to the local security policy of the client PCs if
> neccessary. Right now though, I'm not sure what the solution is. Do You?
> Thanks!
>
Darn...The first link requires a subscription to get to it. Did it say
anything beneficial related to the security restrictions? The other link
just mentioned making the site a Trusted Site which I did.
"Steve C. Orr" <Steve@.Orr.net> wrote in message
news:358833EC-27B7-4400-85C0-EB2CF82C09C1@.microsoft.com...
> There are a lot of security restrictions when using windows forms controls
in
> a webform. That is almost certainly your problem.
> Here's more info:
> http://www.aspnetpro.com/features/2...p200509so_f.asp
> http://www.15seconds.com/issue/030610.htm
> --
> I hope this helps,
> Steve C. Orr
> MCSD, MVP
> http://Steve.Orr.net
>
> "John Smith" wrote:
>
then
but if
box
can
You?
Cool. Thx. I couldn't run the Outlook code without getting a security
exception error. I used caspol (actually mscorcfg.msc) and got it
working...at least I got working from the dev machine which also hosts the
site. Next test will be accomplishing this from the client machine, and
then deploying the security policy to all client machines.
"Bruce Barker" <brubar_nospamplease_@.safeco.com> wrote in message
news:OS$oPQjvFHA.3256@.TK2MSFTNGP09.phx.gbl...
> a couple issues:
> 1) .net code hosted by IE runs in a security sandbox. to access outlook
(or
> call unmanged code like a com object), the users must mark your assembly
> trusted (see caspol.exe).
> 2) it takes a while for IE to spinup a windows forms user control, it must
> load the .net vm, jit the control, etc . this can take up to minute or two
> depending on the assembly.
> 3) the user must have .net framework installed
> -- bruce (sqlwork.com)
>
> "John Smith" <m@.ty.com> wrote in message
> news:e4Yq1eivFHA.3236@.TK2MSFTNGP14.phx.gbl...
but
can
You?
>