Take link in web browser with WP7 - c#

when I click 1 link in web browser of WP7, the new web has been open. But how can I take link, which I just click, into TextBox to use for other aim? It work nearly FF, when u click any link in 1 any page - this link will be shown on the web address.
thank all for support !!

To do this you can use the WebBrowser control Navigating or Navigated event (MSDN link) and pick up the URL from the event arguments.

Use window.external.notify within your HTML page in order to notify your Silverlight application. See the following:
http://www.uxmagic.com/blog/post/2011/06/26/Hosting-an-HTML-App-in-Windows-Phone-7-Mango.aspx

Related

JQuery load page on browser and execute Jquery - No Selenium

We have tried using selenium for testing, but it has numerous setbacks, delays and sudden crashes.
Jquery sounds a good alternative, but the challenge is how to jquerify every page load on the browser.
Brandon Martinez here has an example of how to add jquery to the console of chrome to jquerify a page:
var element1 = document.createElement("script");
element1.src = "http://ajax.googleapis.com/ajax/libs/jquery/1.4.4/jquery.min.js";
element1.type="text/javascript";
document.getElementsByTagName("head")[0].appendChild(element1);
we want that code to automatically be available in every browser page without the need to manually click a bookmark link on every page.
If we get around that then we can use C# code to:
Process.Start("chrome", #"target site");
and since jquery is already available for every page it will do the population and submit we want.
How can I automatically include jquery for every page that gets loaded on the browser? Is it possible to do that via a chrome plugin; jquery or C# code!? Is it at all possible?
I've decided to use Fiddler to modify response body before being displayed on the browser. Now I can jquerify all pages comes to the browser. Look at this link for a detailed example.

How do I redirect the asp.net page that contains a silverlight app from within the silverlight app?

I have a multiview: view1 contains a button and view2 contains the silverlight app - basically a button.
Pressing the asp:button in view1 takes you to view2 and the silverlight app is activated.
How do I make the click of the button in the silverlight app take me back to view1.
I tried to use a WCF service with aspnetcompatibility enabled but that has not yielded results since httpcontext.current.response is null.
Maybe I should use an httphandler?
I was wondering if someone could guide me in the right direction.
Thanks.
You can write a javascript method in the Silverlight hosting page and you can invoke the JS method using
HtmlPage.Window.Invoke("YourJSMethod", parameter);
In the YourJSMethod() javascript method you can write the logic to load the view 1 back.

Browser back button does not work with asp controls

I have a site with few asp:CheckBoxList and asp:DropDownList controls. Checking few options or selecting few items in the dropdowns makes the back button browse to same page just with previous selections. I would like the back button on the browser take the user to the previous website visited. As example: if the last visited site was: default.aspx, then the back button from my current site should go back to default.aspx.
Adding few header options regarding caching only broke the back button to: Page Not Found message.
How can the user browse back to the default.aspx by the first back button clicked on the browser?
Just need to confirm, are u using IE 10 to run the web system?
I had encounter asp control component not working properly when i was using IE 10.
Maybe consider using other browser type like firefox and safari to see if it can work properly

Redirect open link event to extendedwebbrowser tab

I've got a webbrowser in a c# form and when the user click on a link the page opens in the ie10 browser.
All I want is to intercept this event and open the new page in another webbrowser (extendendwebbrowser really).
The fact is that i don't want to know what the user click in the page, but i'd like to intercept all the requests "open new page" from my webbrowser and redirect them to my extendedwebbrowserform and create a new tab with that link.
Thanks for help.
There are at least 2 ways to do that:
Extend the WebBrowser control to intercept the NewWindow2 event, then cancel original request and use that url to open it in a new window. Similar code can be found here or in code project Extended .NET 2.0 WebBrowser Control.
Implement INewWindowManager, and use EvaluateNewWindow to do the same.

How to open a new window without refresh?

I have this code implemented in my application, but whenever i click onto the link, it do help me open a new window. But the original page was "refresh", it kept go all the way back to the top. How can i resolve this problem?
code:
Response.Write("<script>window.open('" + url + "')</script>");
As I understand it, each time you click the link the page is being send to the server where the event is handled (with some C#). If you do that, the server will send the whole page back.
You probably want to control this on client side, with some Javascript.
That said, what you are problably looking for is the attribute target of the link:
something
That will tell the browser that you want to open another tab or windows when the user click the link, and then there request the page specified by url in that tab or window.
Sounds like you want Response.Redirect(myURL)
When you click on the link and handle it in the code behind, that means the link is run at the server side, so it has to post back, which makes it look like it's "refreshing", but it's actually posting back.
You need to handle the opening of the new window on the client's side via Javascript.
If your're writing this to your page, this will redirect you to the url you want
Response.Write("<script>;location.href='" + url + "'</script>");

Categories

Resources