0

I want to browse to an intranet page and click on a button there.

  1. I saw that its possible to to this on winform How to click a button on an ASP.NET web page programmatically? but I need it in asp.net.

  2. i even saw a solution where they turn the stream into a picture of the page. Yet my need it to click a button ruther that to see the page.

For example: I want to load the page www.google.com in an iframe or other component in my asp.net page and then have access to the google search button:

enter image description here

Community
  • 1
  • 1
Asaf
  • 3,067
  • 11
  • 35
  • 54
  • If I understand correctly... You're asking how to programmatically click a button within an iframe from the parent page's JavaScript code? – David Jan 17 '17 at 20:47
  • forget it. Tell us what you really need. – Igor Jan 17 '17 at 20:48
  • Yes but the web page i'm calling is not mine... The "google search" logic should do its magic... Or in my case the relevant button should do the same action it would do if i clicked it manually – Asaf Jan 17 '17 at 20:50
  • set the `src` attribute of `iframe` to `https://www.google.com/search?q=stackoverflow` – Igor Jan 17 '17 at 20:53
  • @Igor:I have a system at work that have page for each item e.g. Http://sys.htm?item=1000 when I click the button the status changes and I need to do it for a lot of items.... Hoped for a shortcut... – Asaf Jan 17 '17 at 20:54
  • @David: I found this: http://stackoverflow.com/questions/27332339/trigger-a-button-click-inside-an-iframe . If this is what you ment? I'll check it out. Thanks – Asaf Jan 17 '17 at 21:04
  • @Asaf - it will not work for you because: "If the source of the iframe is another domain, you can't do that due to cross site scripting restrictions." – Igor Jan 17 '17 at 21:07
  • @Igor. Thank you :) I'll keep searching... – Asaf Jan 18 '17 at 05:23

0 Answers0