473,503 Members | 1,136 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Access Windows Forms Control in IE from code behind

If I have a windows form control declared in my aspx page:

<OBJECT id="wcControl" classid="http:MyControl.dll#MyControls.wcControl"
height="100%" width="100%" VIEWASTEXT>
</OBJECT>

Can I not access it through code behind? Declaring a variable of the
controls type does not initialize it and if I specify a runat=server I get a
runtime error stating a valid guid is required for classid.
Nov 18 '05 #1
3 2272
if you put at runat=server on an object tag, then the object is created on
the server side not the client, same as the script tag. if you want to
control the object tags attributes from the code behind, use a placeholder
and add a generic to it, or us the <%= %> syntax:

<OBJECT id="wcControl" classid="http:MyControl.dll#MyControls.wcControl"
height="100%" width="100%" VIEWASTEXT>
<parameter name="p1" value="<% =myObjectP1Value%>">
</OBJECT>
-- bruce (sqlwork.com)
"Eric" <ms*********@nospammediserve.com> wrote in message
news:eJ**************@TK2MSFTNGP09.phx.gbl...
If I have a windows form control declared in my aspx page:

<OBJECT id="wcControl" classid="http:MyControl.dll#MyControls.wcControl"
height="100%" width="100%" VIEWASTEXT>
</OBJECT>

Can I not access it through code behind? Declaring a variable of the
controls type does not initialize it and if I specify a runat=server I get a runtime error stating a valid guid is required for classid.

Nov 18 '05 #2
Thanks a lot for Bruce's informative suggestions.

Hi Eric,

As for the question "control the IE host winform control" in severside
codebehind code. Here are my suggestions:

The IE host winform control( embeded in web page) are rich client features
in dotnet. In fact, the winform control's assembly will be downloaded to
clientside and then run in client side's dotnet runtim(clr). So there is no
serverside class instance acutally. That's why we use clientside script to
manipulate the rich client winform control embeded in IE. However, if you
just want to do some operations on the certain control's attributes, you
may try Bruce's suggestion that use the embeded <% %> server side script
block in the <object... >.

In addition, here are some tech articles on hosting winform user controls
in IE:

#Host Secure, Lightweight Client-Side Controls in Microsoft Internet
Explorer
http://msdn.microsoft.com/msdnmag/is...l/default.aspx

#Developing Compelling User Controls that Target Forms in the .NET Framework
http://msdn.microsoft.com/msdnmag/is...s/default.aspx

#Controles WinForm (UserControls) en IE
http://www.microsoft.com/spanish/msd...ices/art94.asp

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx


Nov 18 '05 #3
Hi Eric,

Have you had a chance to check out my suggestions in my last reply or have
you got any further ideas on this issue? If you need any further help,
please feel free to post here.
Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Get Preview at ASP.NET whidbey
http://msdn.microsoft.com/asp.net/whidbey/default.aspx

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
36827
by: Richard Dixson | last post by:
I created a new C# web application. Basically all I am trying to do is create a table that consists of a few rows with two columns in each. And then to set those columns to text values from my...
3
1521
by: Dilip | last post by:
Hi I have a windows forms user control that is hosted in IE. This control uses COM Interop to access some RTC related interfaces. The control does not display itself correctly because of this...
2
1345
by: Özden Irmak | last post by:
Hello, Is there an easy way to save some/all properties of a windows forms control into a type of file? I came acros with "Serializable" attribute but it seems that I have to inherit evey...
5
4262
by: Fredrik Melin | last post by:
2005 uses the Partial Class & <form>.Designer.vb for its "windows forms generated code" Anyone know if its faster/better then old 2003 way? Also, when upgrading a 2003 project it did not...
0
1076
by: berek | last post by:
Is it possible to access a method of embedded windows forms control from code-behind code (not from javascript)? I have UserControl.dll embedded within <objecttag and i would like to pass to it...
0
1973
by: gxl034000 | last post by:
Hi, I have been trying to use a .net Forms control in my webpage to open up an application(notepad) on the client. The control works fine when embedded in a windows form, but I keep getting a...
2
4804
by: rn5a | last post by:
Assume that a user control (MyUC.ascx) encapsulates 2 TextBoxes with the IDs 'txt1' & 'txt2' respectively. To use this user control in an ASPX page, the following Register directive will be...
6
2818
by: mgawelek | last post by:
I am doing this in vb.net 2K5 The code below is in a module trying to edit the main form's label control. The error message is: BorderStyle is not a member of System.Windows.Forms.Control. When it...
4
25342
by: clflyer | last post by:
I have a small problem. I'm pretty much a newbie to C# coming out of VB.Net. I have a windows form that has a GroupBox named grpSoldTo. I want to be able to clear all the textboxes and comboxes...
0
7203
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7089
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7282
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7339
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
6995
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5581
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5017
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4678
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
1515
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.