Jag vet tyvärr inte hur man gör i ASP, men det fungerar med ett javascript... Här kommer ett som jag vet fungerar. Lägg in en bild på 1x1 pixlar innanför <body> taggen och sätt width till 100%. Då känner scriptet av hur bred sidan är och redirectar efter det. Ett litet problem är bara att användaren bör ha sin webbläsare maximerad när han accessar sidan, annars blir upplösningen felaktig.
function afterLoad() {
//====== KONTROLLERAR ANVÄNDARENS WEBBLÄSARE ========
window.onerror=null;
var ns4 = 0;
var ie4 = 0;
var ns3 = 0;
var nojs = 0;
if (navigator.appName == "Microsoft Internet Explorer" && parseInt(navigator.appVersion) >= 4) {
ie4 = 1;
} else if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) >= 4) {
ns4 = 1;
} else if (navigator.appName == "Netscape" && parseInt(navigator.appVersion) == 3) {
ns3 = 1;
} else {
nojs = 1;
}
//====== HÄMTAR SKÄRMUPPLÖSNING FÖR INTERNET EXPLORER ========
if (ie4) {
windowWidth = document.images.sidBredd.width;
//====== HÄMTAR SKÄRMUPPLÖSNING FÖR NETSCAPE NAVIGATOR ========
} else if (ns4) {
windowWidth = window.innerWidth;
}
if (ie4 || ns4) {
//====== OM 1024x768 & IE ELLER NN ========
if (windowWidth > 900) {
orgURLLength = top.location.href.length;
orgURL = top.location.href;
newURLStart = orgURLLength - 11;
if (orgURL.substr(newURLStart) != "default.asp") {
newURL = orgURL + "frameset.asp?res=1024x768";
top.location.href = newURL;
} else {
newURL = orgURL.substr(0, newURLStart) + "frameset.asp?res=1024x768";
top.location.href = newURL;
}
//====== ANNARS OM 800x600 & IE ELLER NN ========
} else {
orgURLLength = top.location.href.length;
orgURL = top.location.href;
newURLStart = orgURLLength - 11;
if (orgURL.substr(newURLStart) != "default.asp") {
newURL = orgURL + "frameset.asp?res=800x600";
top.location.href = newURL;
} else {
newURL = orgURL.substr(0, newURLStart) + "frameset.asp?res=800x600";
top.location.href = newURL;
}
}
//====== ANNARS OM T.EX. MACINTOSH 1024x768 ========
} else {
orgURLLength = top.location.href.length;
orgURL = top.location.href;
newURLStart = orgURLLength - 11;
if (orgURL.substr(newURLStart) != "default.asp") {
newURL = orgURL + "frameset.asp?res=1024x768";
top.location.href = newURL;
} else {
newURL = orgURL.substr(0, newURLStart) + "frameset.asp?res=800x600";
top.location.href = newURL;
}
}
}
------------------
/David