passing results from javascript to code behind

  • Thread starter Thread starter Bruce Wiebe
  • Start date Start date
B

Bruce Wiebe

Hi all

i have the following code in a asp.net code behind page that pops up an
alert that at the moment shows the users screen height,

Dim str As String
str = str & "<SCRIPT LANGUAGE=JavaScript>alert(screen.height);</SCRIPT>"
Page.RegisterClientScriptBlock("myscript", str)

What i would like to be able to do is pass the value that is popped up in
the alert box to an asp.net variable somehow. does anyone have any idea how
to do this or any sample code that they would be prepared to share with me.

Thanks in Advance

Bruce
 
Use a hidden form input?

<input type=hidden name=xxx id=xxx>

<script>
myForm.xxx.value=<your value>;
myForm.submit();
</script>

Nathan Smith | Solution Developer
Avanade Inc | West Region
Mobile: 602-502-3606
Messenger: (e-mail address removed)
www.avanade.com
 
Back
Top