NavigateURL and javascript

Discussion in 'ASP .Net' started by David C, Jul 28, 2009.

  1. David C

    David C Guest

    I have an asp menu control that I want to have the navigation run a
    javascript function that I have on the page. I have the bolow javascript
    function and below that is the code line in the page behind to set it. When
    I click on the MenuItem it displays a new page but the URL is my javascript
    command. Can someone help? Thanks.

    David

    function openrental(srecordid) {
    var surl = 'RentalInfo.aspx?rid=' + srecordid;
    //give new window a name so we know where we came from when
    closing task screen
    void window.open(surl, "viadates",
    "height=475,width=400,status=yes,toolbar=no,menubar=no,location=no");
    return false;
    }


    Menu1.Items(0).NavigateUrl = "javascript:return openrental('" &
    strRecordID & "')"
     
    David C, Jul 28, 2009
    #1
    1. Advertising

  2. David C

    David C Guest

    "Mark Rae [MVP]" <> wrote in message
    news:...
    > "David C" <> wrote in message
    > news:%...
    >
    >> void window.open(surl, "viadates",
    >> "height=475,width=400,status=yes,toolbar=no,menubar=no,location=no");

    >
    > Remove the word 'void'
    >
    >
    >> return false;

    >
    > Delete that line
    >
    >
    >> Menu1.Items(0).NavigateUrl = "javascript:return openrental('" &
    >> strRecordID & "')"

    >
    > Remove the word 'return'
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net

    You da man! Thank you, Mark.
     
    David C, Jul 28, 2009
    #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. Mike

    NavigateUrl and Javscript

    Mike, Jul 17, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    394
    Martin Honnen
    Jul 17, 2004
  2. Tomek R.
    Replies:
    7
    Views:
    8,210
    Sobot
    Feb 13, 2009
  3. weiwei
    Replies:
    0
    Views:
    645
    weiwei
    Mar 16, 2006
  4. acadam

    javascript and navigateurl

    acadam, Oct 24, 2006, in forum: ASP .Net
    Replies:
    0
    Views:
    528
    acadam
    Oct 24, 2006
  5. acadam

    javascript and navigateurl

    acadam, Oct 24, 2006, in forum: ASP .Net Web Controls
    Replies:
    1
    Views:
    123
Loading...

Share This Page