UserControl looks different

E

eransha

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.
 
E

eransha

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 said:
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 said:
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.
 
L

Laurent Bugnion [ASP.NET MVP]

Hi,
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/miscctrl/htmlwincontrol.asp

I wouldn't recommend it, though.

HTH,
Laurent
 
E

eransha

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.

Hi,
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/miscctrl/htmlwincontrol.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
 
L

Laurent Bugnion [MVP]

Hi,
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,792
Messages
2,569,639
Members
45,353
Latest member
RogerDoger

Latest Threads

Top