How to refer path in Javascript

Discussion in 'ASP .Net' started by ad, Jun 3, 2005.

  1. ad

    ad Guest

    I place a Loading.aspx in the Util folder of my project, Util folder in in
    the root directory.
    I refer Loading.aspx in this way: ~/Util/Loading.aspx in Javascript, But it
    fail to find Loading.aspx in run time.
    How can I refer Loading.aspx in Javascript?
    Below in the actual code:
    ----------------------------------------------------------------------------
    ----------------------------------------
    JavaScript += "function
    _ShowLoadingWindow(){LoadingWindow=window.showModelessDialog('~/Util/Loading
    ..aspx','','dialogWidth:350px;dialogHeight:200px');}";
     
    ad, Jun 3, 2005
    #1
    1. Advertising

  2. ad

    Joel Leong Guest

    You cannot use ~ (tilde) in client-side code. You need to register this code
    in code behind the grab the root folder using request object.

    "ad" <> wrote in message
    news:...
    >I place a Loading.aspx in the Util folder of my project, Util folder in in
    > the root directory.
    > I refer Loading.aspx in this way: ~/Util/Loading.aspx in Javascript, But
    > it
    > fail to find Loading.aspx in run time.
    > How can I refer Loading.aspx in Javascript?
    > Below in the actual code:
    > ----------------------------------------------------------------------------
    > ----------------------------------------
    > JavaScript += "function
    > _ShowLoadingWindow(){LoadingWindow=window.showModelessDialog('~/Util/Loading
    > .aspx','','dialogWidth:350px;dialogHeight:200px');}";
    >
    >
     
    Joel Leong, Jun 4, 2005
    #2
    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. =?Utf-8?B?amFjb2JyeWNl?=

    How do I refer to a label in javascript?

    =?Utf-8?B?amFjb2JyeWNl?=, Mar 11, 2005, in forum: ASP .Net
    Replies:
    7
    Views:
    41,379
    lightcube
    Jul 9, 2009
  2. Beffmans
    Replies:
    6
    Views:
    1,748
    Beffmans
    Aug 19, 2005
  3. MK
    Replies:
    1
    Views:
    848
    Peter Hansen
    Jun 25, 2003
  4. Replies:
    21
    Views:
    16,400
    Harlan Messinger
    Dec 14, 2007
  5. Peter Afonin
    Replies:
    5
    Views:
    1,428
    Peter Afonin
    Aug 31, 2009
Loading...

Share This Page