Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 676435
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T00:55:38+00:00 2026-05-14T00:55:38+00:00

I want to use an external browser window to implement a preview functionality in

  • 0

I want to use an external browser window to implement a preview functionality in a silverlight application. There is a list of items and whenever the user clicks one of these items, it’s opened in a separate browser window (the content is a pdf document, which is why it is handled ouside of the SL app).

Now, to achieve this, I simply use

HtmlPage.Window.Navigate(new Uri("http://www.bing.com"), "_blank");

which works fine.

Now my client doesn’t like the fact that every click opens up a new browser window. He would like to see the browser window reused every time an item is clicked. So I went out and tried implementing this:

Option 1 – Use the overload of the Navigate method, like so:

HtmlPage.Window.Navigate(new Uri("http://www.bing.com"), "foo");

I was assuming that the window would be reused when the same target parameter value (foo) would be used in subsequent calls.
This does not work. I get a new window every time.

Option 2 – Use the PopupWindow method on the HtmlPage

HtmlPage.PopupWindow(new Uri("http://www.bing.com"), "blah", new HtmlPopupWindowOptions());

This does not work. I get a new window every time.

Option 3 – Get a handle to the opened window and reuse that in subsequent calls

private HtmlWindow window;
private void navigationButton_Click(object sender, RoutedEventArgs e)
{
    if (window == null)
        window = HtmlPage.Window.Navigate(new Uri("http://www.bing.com"), "blah");
    else
        window.Navigate(new Uri("http://www.bing.com"), "blah");

    if (window == null)
        MessageBox.Show("it's null");
}

This does not work. I tried the same for the PopupWindow() method and the window is null every time, so a new window is opened on every click. I have checked both the EnableHtmlAccess and the IsPopupWindowAllowed properties, and they return true, as they should.

Option 4 – Use Eval method to execute some custom javascript

private const string javascript = @"var popup = window.open('', 'blah') ; 
                                    if(popup.location != 'http://www.bing.com' ){
                                        popup.location = 'http://www.bing.com';
                                    }
                                    popup.focus();";

private void navigationButton_Click(object sender, RoutedEventArgs e)
{
    HtmlPage.Window.Eval(javascript);
}

This does not work. I get a new window every time.

option 5 – Use CreateInstance to run some custom javascript on the page

private void navigationButton_Click(object sender, RoutedEventArgs e)
{
    HtmlPage.Window.CreateInstance("thisIsPlainHell");
}

and in my aspx I have

function thisIsPlainHell() {
    var popup = window.open('http://www.bing.com', 'blah');
}

This doesn’t work. I get a new window every time.

Am I doing something wrong? I’m definitely no javascript expert, so I’m hoping it’s something obvious I’m missing here.

Cheers,
Phil

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-14T00:55:39+00:00Added an answer on May 14, 2026 at 12:55 am

    Apparently the problem is that the window.name property is lost when navigating to bing.com. When I navigate to one of my custom pages it seems to be working fine.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Ask A Question

Stats

  • Questions 410k
  • Answers 411k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The three criteria to check when confronted with a ClearCase… May 15, 2026 at 7:38 am
  • Editorial Team
    Editorial Team added an answer http://www.phpclasses.org/package/421-PHP-Free-PDF-generation-class-without-PDFlib.html#download works cool and got the perfect output. May 15, 2026 at 7:38 am
  • Editorial Team
    Editorial Team added an answer Your question is hard to understand. What does "does not… May 15, 2026 at 7:38 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.