get ~/mypage.aspx for use in dynamic javascript

Discussion in 'ASP .Net' started by nic, Jul 25, 2003.

  1. nic

    nic Guest

    Hi,
    I need to get the equivilent of Response.Redirect
    (~/mypage.aspx) for a dynamic javascript function.
    Essentially I am writing the javascript on the non-code
    behind page and need to inject the "~" so I can have a
    relative path to my page. So here is the javascript
    function:

    function showHelp(fieldID)
    {
    var ahref = "FieldHelp.aspx?FieldID=" + fieldID;
    var win = window.open(ahref,"","height=200,width=400");
    }

    I need the ~/FieldHelp.aspx path but don't know how to get
    it. I tried
    var ahref = "<%= ~/FieldHelp.aspx%>?FieldID=" + fieldID;

    but that doesn't work.

    I think injecting serverside code in a dynamic javascript
    funtion makes the function more readable than to build it
    all server side and inject the whole stream.

    Thanks
    nic, Jul 25, 2003
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Tim C.
    Replies:
    1
    Views:
    4,855
    Tommy
    Nov 27, 2003
  2. Ryan Ternier

    movable Div's, MSN's MyPage site

    Ryan Ternier, Jul 16, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    2,946
    Guest
    Jul 19, 2004
  3. =?Utf-8?B?RWFnbGVSZWRASGlnaEZseWluZ0JpcmRzLmNvbQ==

    Error executing child request for MyPage.aspx.

    =?Utf-8?B?RWFnbGVSZWRASGlnaEZseWluZ0JpcmRzLmNvbQ==, May 25, 2006, in forum: ASP .Net
    Replies:
    1
    Views:
    8,696
    =?Utf-8?B?RWFnbGVSZWRASGlnaEZseWluZ0JpcmRzLmNvbQ==
    May 26, 2006
  4. Jason Kester
    Replies:
    0
    Views:
    421
    Jason Kester
    Oct 16, 2006
  5. JDP@Work

    Argh...! MyPage.aspx w/ucMyGrid w/ucMyForm

    JDP@Work, Jun 25, 2005, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    113
    JDP@Work
    Jun 25, 2005
Loading...

Share This Page