UserControl looks different

  • Thread starter Thread starter eransha
  • Start date Start date
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.
 
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.
 
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,

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
 
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
 
Back
Top