Hi !
I have a problem wiht detecting resolution of client web browser
I prepare several files of css style for different browsers and different
resolutions,
(such as : Style_1024x768. css ; Styleff_1024x76 8.css; Style_1280x1024 .css ;
Styleff_1280x10 24.css )
I want to set css style file depends on resolution browser
I wrote this script to detect type of browsers, but i don't have any idea
how to detect resolution ???
<%@ Page Language="C#" AutoEventWireup ="true" CodeFile="Defau lt.aspx.cs"
Inherits="_Defa ult" %>
<script runat="server">
protected void Page_Init(objec t sender, EventArgs e)
{
// Define an HtmlLink control.
string type = Request.Browser .Type;
HtmlLink myHtmlLink = new HtmlLink();
if (type == "IE7")
{
myHtmlLink.Href = "Style_1280x102 4.css";
myHtmlLink.Attr ibutes.Add("rel ", "stylesheet ");
myHtmlLink.Attr ibutes.Add("typ e", "text/css");
// Add the HtmlLink to the Head section of the page.
Page.Header.Con trols.Add(myHtm lLink);
}
else
{
myHtmlLink.Href = "Styleff_10280x 1024.css";
myHtmlLink.Attr ibutes.Add("rel ", "stylesheet ");
myHtmlLink.Attr ibutes.Add("typ e", "text/css");
// Add the HtmlLink to the Head section of the page.
Page.Header.Con trols.Add(myHtm lLink);
}
}
Greetings
Grzegorz