3

I don't know if there is a mechanism to do this: normally one would simply call process start with a URL as the string parameter - has anyone any knowlege or sugestions as to how to add a target?

Google has been singularly unhelpful or else my queries have been a tad useless.

As in the behavior you get with :

<a href="http://www.google.co.uk" target="_blank">link in a new window</a>
John Arlen
  • 6,349
  • 2
  • 32
  • 40
SimonN
  • 353
  • 1
  • 2
  • 13
  • did you see: http://stackoverflow.com/questions/58024/open-a-url-from-windows-forms –  May 04 '12 at 10:21
  • gordatron - that does not address the target issue; it is simply calling process start with a URL – SimonN May 04 '12 at 10:27
  • am I missing something? when i read this I don't know what the difference between URL and target is (sorry if i am being thick). –  May 04 '12 at 10:27
  • Arif - a target as in http://www.w3schools.com/tags/att_a_target.asp – SimonN May 04 '12 at 10:28
  • ahhh so you want to force the link to open in a new window. –  May 04 '12 at 10:36
  • 1
    can you host a webpage that re-directs the user? so all links would be to your web app which re-directs them to the requested page in a new window. –  May 04 '12 at 10:49

2 Answers2

0

What is the harm in launching the default browser ?

you may do this but what if firefox is not available ! !

ProcessStartInfo proc1 = new ProcessStartInfo("firefox.exe");
proc1.Arguments = "http://www.w3schools.com/tags/att_a_target.asp";
                  //"http://stackoverflow.com";
Process.Start(proc1);
V4Vendetta
  • 35,718
  • 7
  • 75
  • 81
  • var call3 = @"http://www.Whatever"; Process.Start(call3); Will call the default browser without a need to specify a particular browser - but it will not set a target! Simon – SimonN May 04 '12 at 10:32
  • 1
    What do you mean by target ? I added your so called target now what is the behaviour you are expecting ? – V4Vendetta May 04 '12 at 10:35
  • 1
    I'm obviously not making myself clear here. If you go to the website referenced you can see the parameters for "target=". One of them is _self; which is defined as: _self Opens the linked document in the same frame as it was clicked (this is default). Now if I open a web page using the Process.Start function and then open anther web page using the Process.Start again these web pages will open in two tabs of the same browser (in i.e.). I want the second page to replace the first page so there is only one tab open - I had identified target=_self as a way of doing that - but any other is OK – SimonN May 04 '12 at 13:14
0

Try selenium and WebDriver for C#.

  • 2
    This may be an answer but I think you need to expand on it. Maybe with links to relevant parts of documentation and some info on the functionality provided by these technologies and how they can be applied to this problem. –  May 04 '12 at 10:46
  • Yes, please provide some more detail. – Jon Nylander May 05 '12 at 08:55