Search:
Namespaces
Discussions
.NET v1.1
Feedback
Automatic Browser compatability
Messages
Related Types
This message was discovered on
ASPFriends.com 'aspngclient' list
.
Mike Simon
-- Moved from [aspngfreeforall] to [aspngclient] by Michiel van Otegem <
Click here to reveal e-mail address
> --
I read somewhere that .net automatically detects the client browser and
recreates the page so that it will be displayed correctly in that
browser. Is there any truth to that and if so, how? I can changed the
schema, but it doesn't allow for me to select ALL browsers :)
Mike
Reply to this message...
Andy Smith
asp.net detects the browser, and sends the Page either a
HtmlTextWriter
=
or a
Html32TextWriter
to render into.
from there, the webcontrols themselves are responsible, somewhat, for =
making sure their output is ok with the browser.
for instance, the
Html32TextWriter
knows that "div" isn't a valid tag in =
html 3.2. Therefore, when a webcontrol tells it's writer to render the =
tag "div", the
Html32TextWriter
turns that into a one-celled table.
however, if the webcontrol just outputs plain text to the writer, then =
there is no translation.
at the end of the day, it's up to the webcontrol authors to make sure =
that their rendering process takes full advantage of the writer's =
knowledge of the html version it was designed to write.
I'm not sure I understand your second question about schemas and =
selecting browsers.
__
Andy Smith
Keyboard Jockey #3a7-2.78.1
[Original message clipped]
Reply to this message...
Michiel van Otegem
ASP.NET indeed checks the browser and changes rendering of server =
controls accordingly (not of the plain HTML in the page). The problem is =
that this doesn't always work properly (try autoformatting and absolute =
positioning with a datagrid and the look at it in Netscape 4... doesn't =
look good, without absolute positiong most goes pretty well).
There are differences between the different browsers that ASP.NET is =
unable to tackle, just because some browsers don't support them (like =
colored borders in a table). Even setting ASP.NET to target a low-end =
browser by default doesn't help.
You can manipulate the default target browser in two ways:
-Set the clientTarget directive and target an alias (Warning! if you =
choose UpLevel, then downlevel browsers will not work). You can define =
your own aliases in machine.config.
-Set the Active Schema to something different (VS.NET support versions =
of IE and Netscape 3.0 by default). This effectively changes how ASP.NET =
(or actually VS.NET) sets up the page at DESIGN-TIME. This will of =
course influence how the resulting page is rendered at RUN-TIME. You can =
see this effect by switch from Design view to HTML view after changing =
the Active schema.
---
Michiel van Otegem
ASPFriends.com Moderation Team
ASPNL.com - ASP/ASP.NET/XML Teacher
http://www.aspnl.com
http://www.aspalliance.com/michiel
---
Teach Yourself XSLT in 21 Days
http://www.amazon.com/exec/obidos/ASIN/0672323184/aspnlcom-20
----- Original Message -----
From: "Mike Simon" <
Click here to reveal e-mail address
>
To:
Click here to reveal e-mail address
Sent: Fri, 2 Aug 2002 15:40:41 -0500
Subject: Automatic Browser compatability
[Original message clipped]
Reply to this message...
System.Web.UI.Html32TextWriter
System.Web.UI.HtmlTextWriter
Ad
MBR BootFX
Best-of-breed application framework for .NET projects, developed by Matthew Baxter-Reynolds and MBR IT
Copyright © Matthew Baxter-Reynolds 2001-2008. '.NET 247 Software Development Services' is a trading style of MBR IT Solutions Ltd.
Contact Us
-
Terms of Use
-
Privacy Policy
-
www.dotnet247.com