I have a results page only working in IE. It is developed using C# and js in visual studio. So I select a search parameter from the drop down list and search. The results from the DB are displayed in a results page. Those results seem to only be displayed when I use IE. Chrome and fireFox allow for everything else to work except the results:/
Any ideas what could be occurring? Something i need to check with my web.config perhaps?
Thank you in advance=)
C
This is likely an html issue and unrelated to ASP.NET. You should examine the generated HTML. It will be especially easy to see if the data is in the DOM by using Chrome and Firebug.
In Chrome (since it's a place where it's not working) bring up the page and press CTRL+SHIFT+I - this will bring up the DEVELOPER TOOLS. Once up, attempt to use the page and watch the CONSOLE tab of the developer tools. You most likely have scripting errors and the Console will point them out. Many times, you can even click on the console-report to go directly to the offending code (but sometimes you cannot). Regardless, the developer console should help you find the trouble.
If it's a CSS issue, the first tab will be the most helpful to you instead - you can find the generated code in HTML and click on it, then all CSS styles will be on the right and you can review them (and even change them if you need to for testing purposes) to find and eliminate trouble items.
Related
Asp.net app runs fine without issues on localhost. However, when published and I access via Chrome/Edge it does not work as intended (will not load the page when button is clicked). Is there a way to see what the live published version is doing in the code?
Tried replicating the issue in Visual Studio Debug, but could not recreate it
ASP.NET code is executed on the server, so there’s not a lot to see in the browser. You can use the Chrome/Edge developer tools (F12) to see what it is seeing, though. There might be helpful information in the console and especially in the network tab, where you can see what requests the app is making and what the server’s responses to them are in some detail. (I’ve had problems with web apps making assumptions about their path that didn’t apply once they were installed.) If you have sufficient access to the server, it might be helpful to look at its logs, especially if your app is returing 500 errors. It’s often a good idea to implement a lot of logging in your web app, using NLog, log4net, or similar libraries. Again, though, you have to have permission to write the logs and to look at them when you need to.
Please follow the normal debugging workflow:
Load a page in your browser.
Open the developer tools.
Select Sources tab; Open HTML file; Open JavaScript file.
Set a breakpoint in the JavaScript file.
Reload the browser page. Loading stops at the breakpoint.
Debug until you find the problem.
Fix the problem (in your usual code editor, not in the developer tools) and save the file.
Debugging tools are supported by most browsers and environments, which make debugging easier by stepping through the code so you can see what's going on.
I'm trying to scrape a particular webpage which works as follows.
First the page loads, then it runs some sort of javascript to fetch the data it needs to populate the page. I'm interested in that data.
If I Get the page with HtmlAgilityPack - the script doesn't run so I get what it essentially a mostly-blank page.
Is there a way to force it to run a script, so I can get the data?
You are getting what the server is returning - the same as a web browser. A web browser, of course, then runs the scripts. Html Agility Pack is an HTML parser only - it has no way to interpret the javascript or bind it to its internal representation of the document. If you wanted to run the script you would need a web browser. The perfect answer to your problem would be a complete "headless" web browser. That is something that incorporates an HTML parser, a javascript interpreter, and a model that simulates the browser DOM, all working together. Basically, that's a web browser, except without the rendering part of it. At this time there isn't such a thing that works entirely within the .NET environment.
Your best bet is to use a WebBrowser control and actually load and run the page in Internet Explorer under programmatic control. This won't be fast or pretty, but it will do what you need to do.
Also see my answer to a similar question: Load a DOM and Execute javascript, server side, with .Net which discusses the available technology in .NET to do this. Most of the pieces exist right now but just aren't quite there yet or haven't been integrated in the right way, unfortunately.
You can use Awesomium for this, http://www.awesomium.com/. It works fairly well but has no support for x64 and is not thread safe. I'm using it to scan some web sites 24x7 and it's running fine for at least a couple of days in a row but then it usually crashes.
The page's model has a string property called instructions which is displayed in a textarea, and whether adding or editing the object, a line break is inserted for no reason that I can find.
Html.TextAreaFor(m => m.Instructions) is the only relevant code. In Chrome and Firefox a line break appears in the text area, but not in internet explorer.
I'm at quite a loss here.
After searching around some more I found out that this has to do with the AntiXssLibrary.
There's more information here
http://forums.asp.net/t/1693760.aspx/1
From reading this, it sounds like it's been fixed in MVC 4
http://aspnet.codeplex.com/workitem/8848
If you're using the AntiXssLibrary and MVC3 you'll have to manually strip the line breaks with javascript.
`Have you any idea why the following code snip I use doesn't produce the expected graph on the browser ?
I have added script tag pointing to latest jquery and kangamodeling's js scripts already.
http://jsfiddle.net/y94Qy/
Thank you for any instructions.
from what I've found so far is that it doesn't seem to work in IE. At least for me using IE9 - simulating IE7 and IE8.
However, for Jsfiddle, the script needs to looks like:http://jsfiddle.net/anAgent/6BcQR/
Just put the include script in the HTML box.
There is a requirement for us to implement browser testing for html and aspx pages. I came across xbrowser at the below link.
http://xbrowser.codeplex.com/
I couldn't find any documentation on their website , it has only solution file. I downloaded the code but its not running fully.
Any help or guidence will be really appreciated.
XBrowser isn't based on Trident (IE), WebKit (Safari/Chrome), Gecko (Firefox) or any other common rendering engine so as far as "browser testing" its pretty much useless. What it is intended for is website automation. You can instantiate it in code, tell it to navigate to a webpage and then tell it various things such as "enter xyz into the search field and click the submit button". If this is what you're looking for then its also very important to understand that just because what you've tested works in XBrowser doesn't mean it will work anywhere else. It might, it might not, you won't know until you manually test every browser.
If you follow the link at the top of the codeplex site you'll see that the project has been moved to GitHub. From there the author has a link to an earlier project call SimpleBrowser that has some examples that I imagine are similar to XBrowser.