By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,962 Members | 1,767 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,962 IT Pros & Developers. It's quick & easy.

passing results from javascript to code behind

P: n/a
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


Jul 19 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
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: na************@hotmail.com
www.avanade.com

"Bruce Wiebe" <Br***@wolfnetwork.net> wrote in message news:<bj**********@hercules.btinternet.com>...
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

Jul 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.