passing results from javascript to code behind

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Bruce Wiebe

    #1

    passing results from javascript to code behind

    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=JavaSc ript>alert(scre en.height);</SCRIPT>"
    Page.RegisterCl ientScriptBlock ("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




  • Nathan Smith

    #2
    Re: passing results from javascript to code behind

    Use a hidden form input?

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

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

    Nathan Smith | Solution Developer
    Avanade Inc | West Region
    Mobile: 602-502-3606
    Messenger: nathan_y_smith@ hotmail.com
    Avanade is the leading provider of digital, cloud and advisory services, sustainable industry solutions and design-led expertise across the Microsoft ecosystem.


    "Bruce Wiebe" <Bruce@wolfnetw ork.net> wrote in message news:<bj230m$hq 8$1@hercules.bt internet.com>.. .[color=blue]
    > 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=JavaSc ript>alert(scre en.height);</SCRIPT>"
    > Page.RegisterCl ientScriptBlock ("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[/color]

    Comment

    Working...