Solved

want to open new window on click of menuitem using navigateurl

Posted on 2013-05-22
8
404 Views
Last Modified: 2013-06-05
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 = "";
        }
    }
0
Comment
Question by:dotnetcode
  • 3
  • 2
  • 2
8 Comments
 
LVL 79

Accepted Solution

by:
David Johnson, CD, MVP earned 250 total points
ID: 39189749
Very dependant upon the browser settings.. i have open all popups in a new tab and it works very well .
0
 

Author Comment

by:dotnetcode
ID: 39190935
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
0
 
LVL 53

Assisted Solution

by:COBOLdinosaur
COBOLdinosaur earned 250 total points
ID: 39191386
You cannot compel anything if the user has decided they do not want popups it is their right to do so. They own the browser, not you.  If you want to display another page then you might want to use an iframe

Cd&
0
Gigs: Get Your Project Delivered by an Expert

Select from freelancers specializing in everything from database administration to programming, who have proven themselves as experts in their field. Hire the best, collaborate easily, pay securely and get projects done right.

 

Author Comment

by:dotnetcode
ID: 39218009
I found the solution after some quick research. Thanks for your inputs on this.
0
 

Author Comment

by:dotnetcode
ID: 39219413
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.
0
 
LVL 53

Expert Comment

by:COBOLdinosaur
ID: 39219414
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&
0
 
LVL 79

Expert Comment

by:David Johnson, CD, MVP
ID: 39221105
the only way it is of help is if the solution is also given to the rest of the community.
0

Featured Post

Live: Real-Time Solutions, Start Here

Receive instant 1:1 support from technology experts, using our real-time conversation and whiteboard interface. Your first 5 minutes are always free.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
xml attribute DTD attribute differences 3 71
jQuery Date picker not working 16 128
Lines Not Lining Up 2 69
How to get statistic's from a competitors website?! 1 103
Preface This article introduces an authentication and authorization system for a website.  It is understood by the author and the project contributors that there is no such thing as a "one size fits all" system.  That being said, there is a certa…
SASS allows you to treat your CSS code in a more OOP way. Let's have a look on how you can structure your code in order for it to be easily maintained and reused.
The viewer will learn how to count occurrences of each item in an array.
The viewer will receive an overview of the basics of CSS showing inline styles. In the head tags set up your style tags: (CODE) Reference the nav tag and set your properties.: (CODE) Set the reference for the UL element and styles for it to ensu…

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question