open .asp page from JavaScript

Discussion in 'C#' started by motheherder, Nov 23, 2006.

  1. #1
    I have used the following

    win = window.open("xycapture.asp?X=" + valueX + "&Y=" + valueY, "coordinates", "width=450, height=500");
    Code (markup):
    from JavaScript the idea being to carry across JS variables valueX and valueY into .asp form, this works fine.

    My question is, is there a way to do this without making the values for valueX and valueY available/visible to the user (currently visible in the URL).

    Grateful for any help or advice

    mo
     
    motheherder, Nov 23, 2006 IP
  2. shaileshk

    shaileshk Well-Known Member

    Messages:
    455
    Likes Received:
    7
    Best Answers:
    0
    Trophy Points:
    108
    #2
    valueX and valueY save in hidden textbox and and make one function when clieck on link that time fire and
    
    <form name="f1" action="" >
    <input type="hidden" name="valueX " value=<%=valueX %>>
    <input type="hidden" name="valueY " value=<%=valueY %>>
    
    <a href="#" onlinkClick()>Link<a/>
    </form>
    
    
    <script language=javascript>
    function onlinkClick()
    {
    document.form.action="xycapture.asp";
    document.form.submit();
    }
    </script>
    Code (markup):
     
    shaileshk, Nov 27, 2006 IP
  3. maro

    maro Peon

    Messages:
    356
    Likes Received:
    16
    Best Answers:
    0
    Trophy Points:
    0
    #3
    or if you don't want to use forms and post, you can always put the values into session variables if you have them available on the server
     
    maro, Nov 28, 2006 IP