How to assign JS screen.width to ASP.Net variable


Posted on 16th Feb 2014 07:03 pm by admin

I've got this ASP.net routine that gets the cookie value of the screen width, but now I need to change it so that it gets the width using Javascript, in case the users don't have cookies enabled. I need something like: Dim myWidth As String = ScriptManager.RegisterStartupScript(Me.Page, Me.Page.GetType, "screenwidth", "screen.width;", True) However, I get a blue line under this and it tells me that it doesn't produce a value How can I do this?

No comments posted yet

Your Answer:

Login to answer
256 Like 33 Dislike
Previous forums Next forums
Other forums

Securing a user input - need some confirmation
Hello All,

I am in the process of recoding a large proportion of an e-commerce site, one of t

Add trigger to UpdatePanel programmatically
Hi,I'm working on a website which uses AJAX and Masterpages. What I have is an AJAX UpdatePanel whi

php libs/ browsercap.in
ok i have a host that refuses to stay current. they control my php settings and libs. is there a way

small inaccuracies
I have this code to convert fractional base 10 into base 2:

while($num > 0)

Embed Video Problem
Hey, thanks for looking!

File to be embedded:

Code: <playlist version="1&q

UDP Multicast question
Hey,

Im not really in the know when it comes to network related programming and activitie

Alternate messaging
I have 4 strings in MySQL db1

$string1 : Hello
$string2 : Hi
$string3 : Great
$strin

same querie, or a new one??
Hi guys,

I'm still working on this drop down list. I've got the actual drop down list to wor

SCRIPT ERROR
Here is the CONTACT FORM I made for our website:

<form id="form1" name="

Multiple while loops
I have several DB queries that I know should be returning results and aren't. I have a feeling it ha

Sign up to write
Sign up now if you have flare of writing..
Login   |   Register
Follow Us
Indyaspeak @ Facebook Indyaspeak @ Twitter Indyaspeak @ Pinterest RSS



Play Free Quiz and Win Cash