locked
OOB open new browser window ? RRS feed

  • Question

  • Can you open a new (full) browser window with HTML content (created in Silverlight) from an OOB Silverlight application ?

     

    If so, how ?

     

    Thanks

    Etienne

    Wednesday, November 16, 2011 4:41 AM

Answers

All replies

  • Thanks !, how about the html content created in silverlight (I don't want to use the web service and store html on the server), I guess I could use file://location_of_newly_created_html_page.html as url (creating a text file [html] using silverlight IO) ? Other ideas ?

    Wednesday, November 16, 2011 5:35 AM
  • In your particular case, does the WebBrowser control not work for you?  It seems that would be the simpliest solution.

    Wednesday, November 16, 2011 5:40 AM
  • In your particular case, does the WebBrowser control not work for you?  It seems that would be the simpliest solution.

     

    Hi Tony, the reason I wanted to open a new full browser window was so that the end-user could print the content [we are shying away from Silverlight's printing abilities since it seems to be slow and create huge temporary files]. If I use the WebBrowser control then I would have to display the content in the OOB window and not have the browser's printing ability (?)

    Wednesday, November 16, 2011 5:48 AM
  • The WebBrowser control has the OS's default browsers printing capabilities.  I built a quick test case just to make sure.  So if you right click the browser window you will the the standard context menu with printing being a part of that.

    You can call javascript in the WebBrowser by using the InvokeScript method on the control.  So you can create a print button in your app and fire off the print() method in javascript on the browser.

    Hope this helps.

    Wednesday, November 16, 2011 5:59 AM
  • Thanks Tony, the javascript print() method prints a blank page, but having the end-user right-click and print is a good enough option for us now.

     

    Regards

    Etienne

    Wednesday, November 16, 2011 9:48 AM