How to access embedded Windows Forms Control in ASP.NET
How to access embedded Windows Forms Control in ASP.NET
How to access embedded Windows Forms Control in ASP.NET
How to access embedded Windows Forms Control in ASP.NET
How to access embedded Windows Forms Control in ASP.NET
How to access embedded Windows Forms Control in ASP.NET How to access embedded Windows Forms Control in ASP.NET How to access embedded Windows Forms Control in ASP.NET How to access embedded Windows Forms Control in ASP.NET How to access embedded Windows Forms Control in ASP.NET How to access embedded Windows Forms Control in ASP.NET How to access embedded Windows Forms Control in ASP.NET How to access embedded Windows Forms Control in ASP.NET
How to access embedded Windows Forms Control in ASP.NET How to access embedded Windows Forms Control in ASP.NET
How to access embedded Windows Forms Control in ASP.NET
Go Back  Xtreme Visual Basic Talk > > > How to access embedded Windows Forms Control in ASP.NET


Reply
 
Thread Tools Display Modes
  #1  
Old 12-22-2008, 11:19 PM
trojanz's Avatar
trojanz trojanz is offline
Junior Contributor
 
Join Date: Jun 2005
Location: Sharjah, UAE
Posts: 299
Question How to access embedded Windows Forms Control in ASP.NET


Seasons greetings to everyone!!!

I'm creating an ASP.NET application and would want to use Windows Forms Control in the pages. I've manage to embed controls via the <object id="someid" classid="http:System.Windows.Forms#someclass name="somename"> HTML tag. Is it possible to access and manipulate the controls via VB.NET code aside from creating scripts?
__________________
Pinoy ako, pinoy tayo! Ipagmalaki mo...

In the keyboard of life, always put your fingers ready for the ESC button...
Reply With Quote
  #2  
Old 12-23-2008, 01:28 AM
Targe Targe is offline
Contributor
 
Join Date: Nov 2006
Posts: 615
Default

Put runat="server" inside the tag and you can use it in your code behind.
Reply With Quote
  #3  
Old 12-23-2008, 01:50 AM
trojanz's Avatar
trojanz trojanz is offline
Junior Contributor
 
Join Date: Jun 2005
Location: Sharjah, UAE
Posts: 299
Default

This is the exact tag I used...

<object id="lvwRecords" name="lvwRecords" classid="http:System.Windows.Forms#ListView" width="800px" height="600px">

...but it is generating an error about GUID....
__________________
Pinoy ako, pinoy tayo! Ipagmalaki mo...

In the keyboard of life, always put your fingers ready for the ESC button...
Reply With Quote
  #4  
Old 12-23-2008, 04:32 AM
trojanz's Avatar
trojanz trojanz is offline
Junior Contributor
 
Join Date: Jun 2005
Location: Sharjah, UAE
Posts: 299
Default

Let me rephrase my question. How can I use winforms control in an ASP.NET application and access it from the codebehind file?
__________________
Pinoy ako, pinoy tayo! Ipagmalaki mo...

In the keyboard of life, always put your fingers ready for the ESC button...
Reply With Quote
  #5  
Old 12-24-2008, 01:18 AM
Targe Targe is offline
Contributor
 
Join Date: Nov 2006
Posts: 615
Default

This article should guide you to what you're more or less wanting:

http://www.codeproject.com/KB/miscct...incontrol.aspx

Basically, this is showing how to access the control from an ASP control's event via JavaScript. It can also be used the opposite way, where an onClick event or such from your control can then do something somewhere else, or to another control.

I only know it's possible from JavaScript, not code behind as I originally thought. Be aware, by doing this control you are limiting yourself to browsers IE6+ and from that small selection, you need user permissions and such. In other words, if you need to accomplish something and ASP doesn't have the control for you, look into making it in JavaScript.
Reply With Quote
  #6  
Old 12-24-2008, 02:35 AM
trojanz's Avatar
trojanz trojanz is offline
Junior Contributor
 
Join Date: Jun 2005
Location: Sharjah, UAE
Posts: 299
Default

Quote:
Originally Posted by Targe View Post
This article should guide you to what you're more or less wanting:

http://www.codeproject.com/KB/miscct...incontrol.aspx

Basically, this is showing how to access the control from an ASP control's event via JavaScript. It can also be used the opposite way, where an onClick event or such from your control can then do something somewhere else, or to another control.

I only know it's possible from JavaScript, not code behind as I originally thought. Be aware, by doing this control you are limiting yourself to browsers IE6+ and from that small selection, you need user permissions and such. In other words, if you need to accomplish something and ASP doesn't have the control for you, look into making it in JavaScript.
Thanks for the tip. Actually I've seen this article and almost every article about consuming winforms controls in ASP.NET pages. and i noticed that most of them uses JScript and nothing about codebehind. Unfortunately, I'm still a virgin in ASP.NET and I don't know quite anything about Java either. I was hoping for a quick escape by coding in the codebehind part of an ASP page.
__________________
Pinoy ako, pinoy tayo! Ipagmalaki mo...

In the keyboard of life, always put your fingers ready for the ESC button...
Reply With Quote
  #7  
Old 12-25-2008, 01:51 AM
Targe Targe is offline
Contributor
 
Join Date: Nov 2006
Posts: 615
Default

I agree, I dislike using JavaScript but sometimes it's just necessary to use.
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

Advertisement:





Free Publications
The ASP.NET 2.0 Anthology
101 Essential Tips, Tricks & Hacks - Free 156 Page Preview. Learn the most practical features and best approaches for ASP.NET.
subscribe
Programmers Heaven C# School Book -Free 338 Page eBook
The Programmers Heaven C# School book covers the .NET framework and the C# language.
subscribe
Build Your Own ASP.NET 3.5 Web Site Using C# & VB, 3rd Edition - Free 219 Page Preview!
This comprehensive step-by-step guide will help get your database-driven ASP.NET web site up and running in no time..
subscribe
How to access embedded Windows Forms Control in ASP.NET
How to access embedded Windows Forms Control in ASP.NET
How to access embedded Windows Forms Control in ASP.NET How to access embedded Windows Forms Control in ASP.NET
How to access embedded Windows Forms Control in ASP.NET
How to access embedded Windows Forms Control in ASP.NET
How to access embedded Windows Forms Control in ASP.NET How to access embedded Windows Forms Control in ASP.NET How to access embedded Windows Forms Control in ASP.NET How to access embedded Windows Forms Control in ASP.NET How to access embedded Windows Forms Control in ASP.NET How to access embedded Windows Forms Control in ASP.NET How to access embedded Windows Forms Control in ASP.NET
How to access embedded Windows Forms Control in ASP.NET
How to access embedded Windows Forms Control in ASP.NET
 
How to access embedded Windows Forms Control in ASP.NET
How to access embedded Windows Forms Control in ASP.NET
 
-->