472,791 Members | 1,779 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,791 software developers and data experts.

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 1059
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.googlegr oups.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.googlegr oups.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.googlegro ups.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
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...
4
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...
2
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...
41
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...
1
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...
9
by: Jacek Jurkowski | last post by:
.... make COM exposed object to have both constructors COM visible not only the first one?
2
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...
2
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...
6
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...
0
linyimin
by: linyimin | last post by:
Spring Startup Analyzer generates an interactive Spring application startup report that lets you understand what contributes to the application startup time and helps to optimize it. Support for...
0
by: erikbower65 | last post by:
Here's a concise step-by-step guide for manually installing IntelliJ IDEA: 1. Download: Visit the official JetBrains website and download the IntelliJ IDEA Community or Ultimate edition based on...
0
by: kcodez | last post by:
As a H5 game development enthusiast, I recently wrote a very interesting little game - Toy Claw ((http://claw.kjeek.com/))。Here I will summarize and share the development experience here, and hope it...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Sept 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
14
DJRhino1175
by: DJRhino1175 | last post by:
When I run this code I get an error, its Run-time error# 424 Object required...This is my first attempt at doing something like this. I test the entire code and it worked until I added this - If...
0
by: Rina0 | last post by:
I am looking for a Python code to find the longest common subsequence of two strings. I found this blog post that describes the length of longest common subsequence problem and provides a solution in...
5
by: DJRhino | last post by:
Private Sub CboDrawingID_BeforeUpdate(Cancel As Integer) If = 310029923 Or 310030138 Or 310030152 Or 310030346 Or 310030348 Or _ 310030356 Or 310030359 Or 310030362 Or...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
0
by: Mushico | last post by:
How to calculate date of retirement from date of birth

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.