UTESTET:
<input type="hidden" runat="server" id="windowWidth" />
<input type="hidden" runat="server" id="windowHeight" />
JS:
window.onload = function(){
var myWidth = 0, myHeight = 0;
if( typeof( window.innerWidth ) == 'number' ) {
//Non-IE
myWidth = window.innerWidth;
myHeight = window.innerHeight;
} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
//IE 6+ in 'standards compliant mode'
myWidth = document.documentElement.clientWidth;
myHeight = document.documentElement.clientHeight;
} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
//IE 4 compatible
myWidth = document.body.clientWidth;
myHeight = document.body.clientHeight;
}
document.getElementById(<%#windowWidth.clientID%>

.value = myWidth;
document.getElementById(<%#windowHeight.clientID%>

.value = myHeight;
}
Du kan altså ikke i første request læse JS variablerne..
Men ellers i andet postback, skulle windowWidth.Text gerne give en værdi.
Brug evt i page_load,
if windowWidth.Text == '' then
response.redirect(.)
end if <-- eller hvordan f.... vb nu engang skal se ud.
Pas på en træls løkke, hvis du skulle støde på en enhed, der ikke giver nogen værdi til felterne, eller ikke har JS aktiveret - Lav noget fall back.