Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ASP.NET Server Controls - behaviour
Message
Information générale
Forum:
ASP.NET
Catégorie:
Autre
Divers
Thread ID:
00687116
Message ID:
00687203
Vues:
12
I have not done that much web development, and am just diving into ASP.NET, so take my comments with a grain of salt. I think the differences in the way each browser renders HTML is fairly well known. I remember when developing with West Wind a couple of years ago, we could tell if it was a Netscape or IE browser, and change slightly the HTML we returned. See inline comments below for more specific answers:

>Continuing my reading of ASP.NET I came across this description of one of the benefits of these controls over the old HTML Server Controls: "ASP.NET server controls automatically detect the client browser requesting the page and render the controls based on the browser's capabilities.".
>
>That sounds most useful, for sure. But I got to wondering how it can accomplish this.
>
>Does anyone know HOW this is achieved?
>It occurs to me that doing this well for any of the possible requesting browsers requires intimate 'knowledge' of that specific browser. While I can easily see there being no problem as regards MS' Internet Explorer, I wonder how NetScape or Opera or any other browser can be adequately 'represented' under this scenario.
>
>It seems to me that this is something that we should be concerned about. Issues surrounding this may include:
>1) Who writes the code responsible for doing the best rendering job for each browser?
>--- Does MS write it for IE, AOL for NetScape, etc.?

Someone at Microsoft.

>2) How does it get installed and maintained on our systems?

I believe it is part of the .NET framework. When ASP.NET realizes that the client browser is Netscape version 3. whatever, and knows that your page wants to display an HTML table, it returns the HTML code that works best with Netscape.

>3) Can the code responsible be maintained separately for each independent browser?
>---a) Can I identify separately the version/level/build of the subject code for each of IE, NetScape, Opera, etc.?

Yes, through Request.Browser. Some sample code from the online docs:

Response.Write("

Browser Capabilities:

")
Response.Write("Type = " & bc.Type & "
")
Response.Write("Name = " & bc.Browser & "
")
Response.Write("Version = " & bc.Version & "
")
Response.Write("Major Version = " & bc.MajorVersion & "
")
Response.Write("Minor Version = " & bc.MinorVersion & "
")
Response.Write("Platform = " & bc.Platform & "
")
Response.Write("Is Beta = " & bc.Beta & "
")
Response.Write("Is Crawler = " & bc.Crawler & "
")
Response.Write("Is AOL = " & bc.AOL & "
")
Response.Write("Is Win16 = " & bc.Win16 & "
")
Response.Write("Is Win32 = " & bc.Win32 & "
")
Response.Write("Supports Frames = " & bc.Frames & "
")
Response.Write("Supports Tables = " & bc.Tables & "
")
Response.Write("Supports Cookies = " & bc.Cookies & "
")
Response.Write("Supports VB Script = " & bc.VBScript & "
")
Response.Write("Supports JavaScript = " & bc.JavaScript & "
")
Response.Write("Supports Java Applets = " & bc.JavaApplets & "
")
Response.Write("Supports ActiveX Controls = " & bc.ActiveXControls & "
")
Response.Write("CDF = " & bc.CDF & "
")

>---b) Can I see which version of the corresponding browser each is designed for?
>---c) Can I have separate versions (of this 'best-render-code') for different versions of each possible browser?
>---d) Can I add/update/remove separate versions of the 'best-render-code' as I see fit?

For answers b-d, I don't think you need to do this, although you can do it inline if you need to.

>4) Does this create a nightmare for maintenance?
>--- Is this another means to push other browsers out of the picture?

I don't think so. It is making it easier to use other browsers, actually. Since you don't have to do so much work to make your application work correctly in all the major browsers, you are more easily able to tell your clients to use any browser. While I doubt it works perfectly, it's a lot nicer than the way it use to be.

>While I can see how nice the concept described by the description (quoted above) is, it looks like it could come at significant cost in terms of future flexibility to choose a browser of preference.
>
>I think that knowing how this is implemented would be useful information.
>
>If you know, I'd appreciate enlightenment.
>Thanks
Chris McCandless
Red Sky Software
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform