Link to home
Create AccountLog in
Avatar of Member_2_6540818
Member_2_6540818

asked on

want to open new window on click of menuitem using navigateurl

Hi,

I need to open a new window on click of a menu item and its using navigateurl as mentioned below.

I tried this it opens a new new tab instead of a new window, I just want a new window and current page need not to be updated, what other things i can do.

  protected void navMenu_MenuItemDataBound(object sender, MenuEventArgs e)
    {

        //webhelp changes
        if (e.Item.NavigateUrl.Contains("PageURL=MenuWebHelp"))
        {
            string PopupWindowScript = @"javascript:window.open('/Medicare/Medicare/Help/Help.aspx?PageURL=', 'HelpDocs', 'top=50,left=50,width=800,height=800,location=no, status=no, menubar=no, scrollbars=no, resizable=yes,').focus();";
           e.Item.NavigateUrl = PopupWindowScript;
                       e.Item.Target = "_blank";
           
           
        }

        if (e.Item.NavigateUrl.Contains("#"))
        {
            e.Item.NavigateUrl = "";
        }
    }
ASKER CERTIFIED SOLUTION
Avatar of David Johnson, CD
David Johnson, CD
Flag of Canada image

Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
Avatar of Member_2_6540818
Member_2_6540818

ASKER

whatever the settings browser has, the new page should display in new window rather than new tab, what can i do this to make it default and compulsory behaviour
SOLUTION
Link to home
membership
Create an account to see this answer
Signing up is free. No credit card required.
Create Account
I found the solution after some quick research. Thanks for your inputs on this.
I've requested that this question be closed as follows:

Accepted answer: 0 points for dotnetcode's comment #a39218009

for the following reason:

I found the solution after some quick research. Thanks for your inputs on this.
Conventionally, when a member finds their own solution, they post it.  Otherwise the question is just a bit of empty trash in the database that is no help for anyone finding it in a search.

Cd&
the only way it is of help is if the solution is also given to the rest of the community.