I have a website that uses bootstrap and I am accessing the website through a wpf form using the web browser control.
When I navigate to certain pages I get a script error window that says Invalid operand to instanceof: Function expected
The WPF form is my way of recreating a client's application where this same issue is occurring.
I can only change the html of the site , has anyone experienced this and found a solution ?
Is there a way to turn on debugging so i step thru and find what is calling the code
Has anyone specifically experienced something like this with the wpf browser control, and how did you get past it?
I figured it out: I stumbled across an entry on Rick Strahl's weblog (https://weblog.west-wind.com/posts/2011/May/21/Web-Browser-Control-Specifying-the-IE-Version) about the web browser control, and in one of the comments, a commenter said that he tried adding the following meta tag to the page:
<meta http-equiv="X-UA-Compatible" content="IE=11" />
So I put that in the master page of my application, and everything worked!
Related
I have a .NET Webform ReportViewer control. When I run it locally everything is fine. But when deployed to a server it won't render. debugging on the browser shows that the iframe that handles everything is simply not present.
this is all in a custom control that was here before my time. So basically when the render method is called the custom control adds the controls to a panel control, then uses the HTMLWriter class so create a div, calls .Render() and then passes in the HTMLwriter. I used string comparison to see if the iframe was somehow being sanitized(for security) by the browser, but it is not. I have verified the server has v 8,9, and 10 of both ReportViewer.Common and ReportViewer.Webform. I have tried referencing all of these in my web.config and msproj references and still no joy. Its the weirdest thing, same microsoft library, 2 different boxes, writes two different HTML strings.
Anyone seen anything like this. I have definitely checked through SO and found most of it has to do with the missing assemblies from the GAC, but I am seeing all of them present. Environment issues are so frustrating!
So it looks like this was an environment issue after all and had nothing to do with the code. The custom control that contained the report viewer control was blocking it from allowing errors to bubble up since it was directly writing the render to HTML. It turned out to be Report Server permissions.
I have implemented the Facebook Like and Send button plugin. Look I think its fair to say that this should be fairly straightforward and having stepped though the process I was very happy that this was the case.
I am having an issue now that is causing me some difficulty resolving.
The issue is around an inconsistent display and functionality of the plugin. It works perfectly for some of our site pages and doesnt work at all for others.
On the pages where the plugin does not work the Send Button doesnt appear and when the Like Button is clicked it opens the Like Dialog very briefly and immediately closes it without any Like Action being recorded
I have checked all of the site pages through the Facebook Debugger tool and all the pages are being scraped correctly with correct Open Graph Meta Tags etc...
At this stage I am wondering if anybody has had this issue? I am aware that there were issues with the Send Button this year but my understanding was that these issues had been resolved...
website url that displays incorrectly is: http://www.todaysdeals.ie/Deal.aspx?dlid=441
website url that displays correctly is: http://www.todaysdeals.ie/Deal.aspx?dlid=439
It looks to me like the problem is in how you're declaring the button code. You've specified a width of 90px in the FBXML code, but Facebook seems to be ignoring this and rendering its code at 150px.
My guess is on the incorrect page, you've got a large number of likes on this page, and it's wrapping the buttons into a hidden area of the div.
I'd start by increasing the width in your FBXML code to at least 176px and see what happens.
How to turn off javascript in a WPF Frame element. It pops up with a:
"Script Error. An error has occurred in the script on this page"
frame1.Source = new System.Uri("http://www.stuff.co.nz");
If your version of .NET for this application supports it, have you tried using the WebBrowser control?
http://msdn.microsoft.com/en-us/library/system.windows.controls.webbrowser.aspx
Update: I found a blog post that has a fix for this, although it doesn't do exactly what you wanted. It uses javascript script injection to disable javascript errors. I have not tested this.
http://www.codewrecks.com/blog/index.php/2010/08/31/disable-javascript-error-in-wpf-webbrowser-control/
The web site was built on asp.net platform. Ajax enabled. It works very well on
ie or chrome, but it does not work on mozilla...?
You see arrows work great but the numbers does not appear?
how can i fix..
http://dexiab-2.hosting.parking.ru//Default.aspx#world the link to see the detail..
I think that the problem is the label tag that you use, change the label to span (or div), and probably its going to work.
I have a class of library code which uses a System.Windows.Forms.WebBrowser control to load a web page then extract information from the DOM tree, etc... I've found this to be the only reliable way to be able to parse information loaded onto a page with javascript, etc...
This worked fine when testing with console app, but when I call the same method from an asp.net page (ASP.NET MVC Controller) it crashes with a "ActiveX control '8856f961-340a-11d0-a96b-00c04fd705a2' cannot be instantiated because the current thread is not in a single-threaded apartment."... i've tried adding [STAThread] to my method but that doesn't seem to help!
Any ideas?
Thanks
Update:
I need to allow a page to complete load and execute all its javascript, then search it for text that matches a template I have already stored... Don't think HtmlAgilityPack will work? Does WatIn run the javascript?
Save yourself a lot of headache and use WatiN instead of a WebBrowser control.
See this question: Best method for Website Automation?
I believe it is impossible to get IIS to run in single thread apartment model (STA). Instead of using the WebBrowser control, you could take a look at the HTML Agility Pack. It will let your read in a web page and poke around the DOM. The WebBrowser control uses lots of computer resources that you won't have to worry about it make the switch.
Everything in the System.Windows is intended for desktop, not web stuff. I agree with Jake Pearson that you should use something else. But if you want you can try forcing the page into STA mode using this directive:
<%#Page AspCompat="true"%>
http://msdn.microsoft.com/en-us/library/zwk9h2kb.aspx