Hacker News new | ask | show | jobs
by manuscreationis 4957 days ago
Is this HTML that you control?

If you're loading it through a C# WinForm control, you might be able to do something like pre-inject a hidden input tag onto the page with a particular name/value, and then in the javascript on the actual page, check for that tag to determine if the page was loaded via a form... I'd guess you'd make a HttpWebRequest out to the resource you want, manipulate the response in some way, then load it into your viewable control... I'm shooting from the hip here, so this is just a guess. I haven't worked in WinForms for a while now.

You might want to look at your approach, however... Are you absolutely in need of having this page be loaded through a WinForm?

Edit: Also the dude suggesting you post this on SO is correct

1 comments

I have only control on the web app, not the clients.

It is posted on SO in parallel, but there is no help at there, so I thought to try my luck in this community.

Might be able to do UserAgent parsing then... since you're doing a very specific target, it might (keyword might) be simple to do a string compare against whatever the UserAgent of the WinForm app is (I have no idea what it would be, but you could test this very easily), and use that as how you detect.