473,796 Members | 2,599 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

UserControl looks different

Hello,

I have created a UserControl in c#, and put it inside a web page. The
control contains a listbox and a button. For some reason the control
looks different when I use it on a "normal" form (windows application)
than it looks when used within a webpage. For example the button loses
its 3D look.

Can anyone explain this behavior? (I'm using IE 6 the ASP page is using
..net 2.0).

Thanks.

Jan 1 '07 #1
6 1091
They are not supposed to look the same. A windows form is rendered by
Windows. A web form is rendered by a browser. Two different worlds.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"eransha" <er************ @gmail.comwrote in message
news:11******** **************@ s34g2000cwa.goo glegroups.com.. .
Hello,

I have created a UserControl in c#, and put it inside a web page. The
control contains a listbox and a button. For some reason the control
looks different when I use it on a "normal" form (windows application)
than it looks when used within a webpage. For example the button loses
its 3D look.

Can anyone explain this behavior? (I'm using IE 6 the ASP page is using
.net 2.0).

Thanks.

Jan 1 '07 #2
Eliyahu,

Thanks for the response. But both window form and browser "see" the
same graphic dlls when it comes to .net GUI, otherwise what's the point
in desiging the GUI of a user control if it ends up totaly different?

Eliyahu Goldin wrote:
They are not supposed to look the same. A windows form is rendered by
Windows. A web form is rendered by a browser. Two different worlds.

--
Eliyahu Goldin,
Software Developer & Consultant
Microsoft MVP [ASP.NET]
http://msmvps.com/blogs/egoldin
http://usableasp.net
"eransha" <er************ @gmail.comwrote in message
news:11******** **************@ s34g2000cwa.goo glegroups.com.. .
Hello,

I have created a UserControl in c#, and put it inside a web page. The
control contains a listbox and a button. For some reason the control
looks different when I use it on a "normal" form (windows application)
than it looks when used within a webpage. For example the button loses
its 3D look.

Can anyone explain this behavior? (I'm using IE 6 the ASP page is using
.net 2.0).

Thanks.
Jan 1 '07 #3
"eransha" <er************ @gmail.comwrote in message
news:11******** **************@ a3g2000cwd.goog legroups.com...
But both window form and browser "see" the same graphic dlls
when it comes to .net GUI,
???
Jan 1 '07 #4
Hi,

eransha wrote:
Eliyahu,

Thanks for the response. But both window form and browser "see" the
same graphic dlls when it comes to .net GUI, otherwise what's the point
in desiging the GUI of a user control if it ends up totaly different?
I think you are confused about ASP.NET. In WinForms applications, the
rendering engine is .NET on Windows. The controls look accordingly. On
ASP.NET, however, the rendering engine is the web browser's HTML engine.
It's a totally different environment, not even mentioning a different
application model. The fact that it's a User control doesn't change it.

That said, there is a possibility to expose WinForms user controls on IE
only, and on Windows only, as an ActiveX control. The .NET framework
must be installed on the client. Is that what you want?

http://www.codeproject.com/cs/miscct...wincontrol.asp

I wouldn't recommend it, though.

HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Jan 1 '07 #5
Laurent,

This is exactly what I did. I compiled a UserForm into a dll and loaded
it in two ways:
once in a normal windows forms application, and once as a part of the
web page. The control looks different on each.
Laurent Bugnion [ASP.NET MVP] wrote:
Hi,

eransha wrote:
Eliyahu,

Thanks for the response. But both window form and browser "see" the
same graphic dlls when it comes to .net GUI, otherwise what's the point
in desiging the GUI of a user control if it ends up totaly different?

I think you are confused about ASP.NET. In WinForms applications, the
rendering engine is .NET on Windows. The controls look accordingly. On
ASP.NET, however, the rendering engine is the web browser's HTML engine.
It's a totally different environment, not even mentioning a different
application model. The fact that it's a User control doesn't change it.

That said, there is a possibility to expose WinForms user controls on IE
only, and on Windows only, as an ActiveX control. The .NET framework
must be installed on the client. Is that what you want?

http://www.codeproject.com/cs/miscct...wincontrol.asp

I wouldn't recommend it, though.

HTH,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Jan 2 '07 #6
Hi,

eransha wrote:
Laurent,

This is exactly what I did. I compiled a UserForm into a dll and loaded
it in two ways:
once in a normal windows forms application, and once as a part of the
web page. The control looks different on each.
I see. Unfortunately, I don't have experience with this.

Sorry,
Laurent
--
Laurent Bugnion [MVP ASP.NET]
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Jan 2 '07 #7

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

Similar topics

2
2670
by: bill yeager | last post by:
When trying to run my web project, I get the following error: Parser Error Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Parser Error Message: The base class includes the
4
3119
by: Harry | last post by:
Hello, I have a page with a RadioButtonList and a PlaceHolder control. The RadioButtonList's AutoPostBack attribute is set to TRUE and its SelectedIndexChanged event loads one of three UserControls into the PlaceHolder's child control collection depending upon which of the three radio buttons is selected. Each of the three UserControls have postback events themselves triggered by button clicks. The problem I'm having is keeping track of...
2
4633
by: Sascha | last post by:
Hi there, I searched carefully through the web before finally deciding to post this message, because I could not find a solution for my problem. Hopefully someone will have a hint or explanation for me! I apologize for the length of this posting, but I wanted to make sure that I get an answer other than "Hey man, just use LoadControl!", because this is not what I want. The Task: Isolate a collection of web forms which are created as
41
4331
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based on some initialization information obtained elsewhere. Basically, I'm going to create my own dynamic toolbar where the toolbarbuttons can change. I'm not using the VB toolbar because of limitations in changing things like backcolor (I can't get...
1
3250
by: Giovanni | last post by:
Dear Friends/Gurus, I have exhausted myself and have yet no solution to the following: I have an ASP.NET 2.0 Survey type application. On a page, I have placed a GridView which is bound to an SQLDataSource. The GridView contains 3 columns: QuestionNumber, QuestionText, and a TemplateField. Each row in the GridView represents a question in a table (Ex.: "18. Satisfaction Level").
9
369
by: Jacek Jurkowski | last post by:
.... make COM exposed object to have both constructors COM visible not only the first one?
2
5072
by: Steve | last post by:
This is a weird one. I have a series of "SmartParts" which are CAB (Composite Application Block) Views which are finally just UserControls (99% of the time) Anyway, I layout my UserControl in the VS2005 designer, but at runtime, the controls are in different locations and different sizes. I have been able to restore their sizes by putting a hack together that will set their sizes to the correct values in the UserControl's Resize...
2
8935
by: Rene Sørensen | last post by:
In VS 2005 I'm trying to create a usercontrol, but I have some problems with it right now I can't figure out how to fix. The size of my usercontrol is "Size 574; 619" I have anchored all controls added to the form, so I can resize it up and down, and not left and rigth. My usercontrol is a usercontrol project. In my main program I just drag and drop the control from the Toolbox, her the problems starts, the size of all subcontrols changes...
6
12141
by: MeowCow | last post by:
I have created a UserControl that encapsulates a third party data grid. My goal was to create my own DataSource and DataMember properties that forward the binding to the third party grid, then use binding like normal. The problem I am running into is that my UserControl ends up with a different BindingContext then the ParentForm it is contained in and thus all other controls on the parent form. (I want various controls on the form to...
0
10449
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10003
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9047
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7546
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6785
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5440
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5568
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4114
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 we have to send another system
2
3730
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.