Silverlight navigation problems under IIS - silverlight

I’m totally confused.
I’ve hosted my app under IIS on my machine (windows 7). If then I open IE and enter "http://localhost/MyApp.aspx#SomePage" it will really open the app and then navigate to that “SomePage” page. If then I’ll navigate to another page, address bar updates accordingly (i. e. "http://localhost/MyApp.aspx#SomeOtherPage"). So everything is fine.
But if I enter in browser "http://mypcnetworkname/MyApp.aspx#SomePage" it simply opens my app with the default page and doesn’t navigate to SomePage. If then I'll navigate to another page, address bar also doesn’t update. Navigating through screens doesn’t update nor history frame not address bar and vice verca — looks like browser navigation is disconnected from silverlight navigation (but I’m still able to navigate through application using hyperlinkbuttons in it).
What can I do to make it work? I guess it’s more iis configuration problem (however everything is default, except mime type for silverlight) than related to silverlight.
P. S. It’s an silverlight 4 app but I do have silverlight 5 installed on my machine.

one way to get around this would be use asp.net to write SomeOtherPage to the launch paramters of the html object.
You then can parse these values when you launch the application and make the switch your self in silverlight
heres a link on passing paramerters: Link

Related

reCAPTCHA v2 with wpf webbrowser / frame control

reCAPTCHA has limitation on browser supports however it works on IE without adding any value in compatibility mode. I have been trying multiple things with WPF application which is displaying a webpage hosted inside a Frame (or Web Browser) control. That webpage has Google reCAPTCHA V2 (I'm not a robot). It works fine in all the browsers but inside WPF app it fails to display properly.
Based on following link we need to have specific browser support
https://support.google.com/recaptcha#6262736
I also made sure javascripts are enabled and working fine. Any suggestion?
I ran into this issue as well and the only thing I know how to make it work is go into the recaptcha admin console and slide the security preference to the easiest so the webBrowser control can do the image verification at the very least
Update:
Found out basically because the web browser control is IE 7 by default
Use latest version of Internet Explorer in the webbrowser control

How to open application from a webbrowser windows phone

I am developing a windows phone application.
In a page I placed a button and on this button click I open the webbrowser and redirects to our website pages for some processes. There are many webpages. In the last webpage we added a button "Close". In the close button click I want to close the webbrowser and open the application back with the last state before opening the webbrowser. How can I do this ?
Thanks.
I will refer to the button in the app as "app button" and the button in the web page as "close button".
Add a WebBrowser control called webBrowser1 to the Windows Phone app. Make it cover the entire screen, and set it's Visibility property to Collapsed.
On the app button's click event, use
webBrowser1.Visibility = System.Windows.Visibility.Visible;
webBrowser1.Navigate(new Uri("http://yourwebsite.com/page");
to show the web browser and navigate it to the first page on your website.
Make the close button on the last page of your site navigate to a new page on your site, called "close.html" or whatever you want. In javascript, this would look like
<Button onclick="window.location.href='http://yourwebsite.com/close.html';">
Back in the app: On webBrowser1's Navigating event use,
if (e.Uri.ToString().Contains("close.html"))
{
webBrowser1.Visibility = System.Windows.Visibility.Collapsed;
}
When the you click the button on the last page of your site, it navigates to "close.html". When this happens, the Web Browser's Navigating event fires. Since this event fires every time you change pages, you need to check to see if the new url contains "close.html", the page your close button is navigating to. If it does, the Web Browser will be hidden and you will see your app again.
.
(In VB, the code would be )
webBrowser1.Visibility = System.Windows.Visibility.Visible
webBrowser1.Navigate(New Uri("http://yourwebsite.com/page")
And
If e.Uri.ToString.Contains("close.html")
webBrowser1.Visibility = System.Windows.Visibility.Collapsed
End If
Edit: I was thinking in generic terms when i wrote the answer and did not remember that you are asking specifically about the webbrowser (hence, using a webbrowsertask launcher). Thank you #Claus for point out the OAuth situation. So, i am amending my answer to explain that it is possible and also mention an issue with using the launcher as there is no way guarantee to return back to a given point in your launcher app (as it is with choosers due to the availability of callbacks).
It is not possible to achieve this in general terms. That is, there is an application A which opens another application B and from application B you would like to close-it-and-open-A. There are many reasons why i think it is not possible:
- How does one get the address/reference to the application A. No API for that at the moment.
- There is no content-handler/plugin where a 3rd party can register an app with the web-browser.
- Most importantly, security, security, security. This would open doors for attacks from the web.
However, for your requirement of application B being a web-browser, it is possible to use a task launcher WebBrowserTask. As #claus suggests, you could have Window.close() javascript in your last page to close the browser and hence reveal the app underneath it (hopefully, A). The problem here is that if, the user opens an app (let's call it C) after the browser has launched (and before the browser is closed), and the user does not close C, then when the browser gets closed, the user will be returned to C and not to the launcher App! This is not what you want based on your requirement.
So, if you would like to achieve the kind of effect you are describing in your question, it is best that you embed the Web-browser in your application (as a full-screen app) and from that vantage point you can interact between the web-browser (control) and the (host) app via Javascript.
Hopefully, this helps.

Can't exit Salesforce Development Mode

When I have the Development mode enabled for my profile, and I open a custom VisualForce page, the code-editing window/frame appears on the bottom of the screen.
Problem: for 7-8 months now, this window does not disappear when I am done with the custom VF page and go on to strandard pages. It's just sitting there, and displays the code for the original VF page. In addition to that, it's keeping the custom VF's URL up in the address bar of the browser, which interferes with other VF pages which take a use of the URL data.
I have submitted this as an issue to SF Support, who had pounded on it for months, and did not resolve.
Have you experienced this problem before, or know how to fix?
I've had this problem before and found the Development Mode toolbar at the bottom of pages particularly annoying. It doesn't work with some of the Firefox plugins that I use. So, I turned it off.
To edit a page without Development Mode turned on, go to Setup > Develop > Pages (or Apex Classes for controllers).
If you'd rather keep Development Mode on you may want to try updating your browser, or try using a different browser (Internet Explorer, Firefox, Chrome).
You can also use the url parameter
core.apexpages.devmode.url=1
in the address of any VF page to temporarily disable the development Mode toolbar.

Silverlight Notification API in-browser

I'd like to use the Notification API to create toast notifications for a Silverlight app designed to run both in and out of the browser, but the NotificationWindow class is only available OOB.
Does there exist anything that can replicate the behaviour inside the app? My idea is to have a container in the bottom right of the screen overlaying all other content. Then, create a wrapper which detects OOB-mode, passing params to the Notification API if possible, or populating and showing my own container if not. Is there anything that does this available?
It seems strange that MS chose not to implement something like this, as has been pointed out before.
Displaying a notification in browser is simple. You just need to use a popup and make it appear in the right place. See the following post as an example.
Now the difference with that approach is that the notification will show inside the browser. In OOB it shows outside the window and it's visible even if the windows is minimized. Due to security reasons it's not possible to directly do this.
Out of interest, Chrome Applications like Tweetdeck and Gmail, are able to display notifications outside of the browser. I think this might be a possiblity, but not exactly a Silverlight and cross browser solution.

Silverlight multi-page with browser back/forwards

I can present multiple pages in Silverlight using
Content = new DetailsPage();
However is this can be confusing to a user who may not even know the page is in Silverlight and would be expecting to hit the back button on the browser.
Obviously I can add my own buttons but this doesn't seem right.
How can I allow "normal" browser navigation using the back/forwards button?
In Silverlight 2, you can still handle navigation. It's just a more manual process.
Call
HtmlPage.Window.NavigateToBookmark("blah");
to add the "#blah" to the end of the URL.
Call
string bookmark = HtmlPage.Window.CurrentBookmark;
to find out where you currently are. People are also tying into jquery/Asp.net AJAX libraries to use their navigation support.
In Silverlight 3, you can use the Navigation Framework to do some of this automatically. File->New Project->Silverlight Navigation Project.
You should really formulate a question.
I'll assume that you want to know how to achieve multi-page navigation with browser back-button support.
There one simple answer, which is to use Silverlight 3 where it is supported out of the box, as well as in-app navigation using the address bar.
Release date is set for july 10, so there's not much longer to wait.
Be careful, you cannot at the moment install both Silverlight 2 and 3 on one machine, and there is no end-user plugin available (only developper runtimes, to install manually).

Resources