ASP.NET - Issues with position of controls in IE8 - c#

recently I've moved on to testing my web aplication in IE8, however, I've noticed that the position of my controls now all over the place. This was not apparent when I was testing my app with IE7 and Firefox 3.5. I know that there is a suggested "fix" for this issue by including
meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7"
into the HTML source, but I think it might be better if I changed my app to natively support IE8, instead of falling back to Compatibility Mode.
All my controls are positioned by offsetting from normal flow, but I've also noticed that even if they are positioned in normal flow or absolutely positioned, the problem still exists.
I'm developing my app entirely in C# as I have much to no knowledge of CSS, but I have no qualms about changing that if that's the path to solving this issue.
Thanks.
Edit: I'm using Visual Studio 2005 btw
Edit: After more forum diving, I found a link to a nice blog entry # http://blogs.msdn.com/ie/archive/2009/03/12/site-compatibility-and-ie8.aspx which lists some quick differences between IE8 Standard View, IE8 Compatibility View and IE7 which might break a site. Hope it helps other people facing similar issues.

If you are building a website, you'll have to use CSS.
This is a good resource for starting with CSS - http://www.w3.org/Style/CSS/learning
Css will allow you to create a website that works for most modern browsers. Here's a good table for matching CSS version and browser version: http://www.quirksmode.org/css/contents.html
However, there are some browsers - notably IE6 - that haven't implemented the CSS guidlines properly. This results in the need for IE6 specific CSS hacks for anything remotely sophisticated.
This is a good strating point for browser hacks:
http://articles.sitepoint.com/article/browser-specific-css-hacks#

Honestly the issue really lies in your markup and CSS rules. IE8 is much more compliant to the W3c CSS standards. So you most likely have had issues with FireFox, Opera, Chrome and Safari you did not know about. The non-IE browsers will not honor your IE7 tag.
My advice is to make your page work in the new browsers, keep things relatively simple so you can make it work in IE 6 and 7. IE 6 really needs to just go away, but alas too many folks wont upgrade. IE 7 honestly needs to be phased out as well.
I have been writing a series I am calling Thin ASP.NET that sort of focuses on doing things in CSS layouts for ASP.NET sites, http://professionalaspnet.com/archive/tags/Thin+ASP/default.aspx

CSS can be rather daunting when you are first beginning using it, personally I like to use a CSS editor. I use Skybound Stylizer (www.skybound.ca). They offer a free basic version, which is really all that you need to begin and to even publish a website, but at only $79 I upgraded to their Ultimate edition to show my support and I am still loving it :)
I suggest checking it out. It will allow you to make changes and see instantly what happens, it also supports the ability to view the page as you would in IE or Firefox with additional support to make it easy to make conditional CSS comments for separate browsers.
Hope this helps,
David.

Related

Is it better to capture Coded UI for replay on Firefox, by using an older (non-latest) IE?

I'm looking to capture some Coded UI using C#, in order to playback in Firefox.
Captures, of course, need to be taken in Internet Explorer.
Right now, I have the latest version (version 10). I am hearing that this can cause issues, with, for example, Radio buttons.
Is it better to capture, with say, IE8 for example? If so, I'm thinking playback will be more effective from a couple of exceptions I'm getting, specifically to do with 'hidden' elements.
Often, issues are attributed to Microsoft Security Update KB2870699.
If I recall correctly, Microsoft introduced Selenium components for Coded UI testing in VS 2013, perhaps in 2012. The requirements for test recording are IE9 or IE10 (or greater?) for VS 2013 per MSDN, so you probably cannot even record in IE8 - but your mileage may vary.
The big issue you may run into with record and playback is if the application you are targeting renders differently for different browsers, for example based on User-Agent. Because the record-and-playback still uses the same Coded UI API under the surface, if for example and ID of a control or a hierarchy is different, or a <span> renders as a <div> in a different browser, you may need to adjust the test after it is recorded.
You'll only truly know by running the test cross-browser and inspecting the reason for the failure. The recording creates a designer-file of Properties, etc., which you can refactor from UIMap.Designer.cs to UIMap.cs and adjust as necessary. Remove the GeneratedCodeAttribute from the method that you bring over for best practice.
You might find a healthy mix of recorded and adjusted Coded UI tests, or you may opt for direct access to APIs of another framework such as Selenium directly. In summary - recorded tests are quick to generate, but are brittle to changes in rendering. Recording in one browser should not affect its ability to playback and pass; otherwise other issues may be at play.

enable javascript on webbrowser control win ec 7

this is my first post in here.
I searched all over the web for a solution to this problem, but i have not found nothing.
I only read that Webbrowser haven't much support for javascript in win ec7.
But my first question is:
-Why a web page with javascript works fine in IE in wec7 and doesn't work in a webbrowser on the same platform?
I enabled all script options from the control panel, but it still not works.
How can I make the page works in webbrowser as it works in ie?
Thanks in advance for the help or the tips.
bennaloz
Q.
-Why a web page with javascript works fine in IE in wec7 and doesn't work in a webbrowser on the same platform?
A.
The compact framework has a much smaller Operating System than full blown Windows, otherwise it would be too large to fit on the device.
To make the compact framework smaller, many features that Microsoft could not foresee a use for were left off.
When Windows CE and Windows Mobile were first introduced, not many people were trying to use these devices to look at online content. A web browser was included, but a lot of things in this web browser were also limited (for the same reasons). Therefore, some JavaScript may work while other JavaScript will not.
Nothing is guaranteed to work with JavaScript, though.

Looking for a updateable & secure WebBrowser-Framework

I would like to implement a web browser in my c#-program. The browser should cover some requirements:
It should be updateable
I'm not sure if this is possible, but it would be great if the implementet web-browser would alwasy be using the latest version of the based browser which is installed on the system.
Easy implementation
Of course, the easier to use, the better!
Security
And the used browser should be as secure as possible. The safest i could think of, was running the browser in sandboxed mode. Are there other possibilities to achieve a maxiumum of security?
Untill now i have found some wrappers for different Browser-Engines, but none of hem seems to match my requirements:
Awesomium: Is very easy to use! But is still based on an old Version of Chrome (12.0.702.0)
Berkelium: Same as Awesomium, i think.
CefSharp:
GeckoFX: Needs FireFox 1.5 installed
MozNet: Based on FireFox 3.6
WebKit.NET: I'm not sure about that...
the native WebBrowser Class: I think this is the best i could get - because it always uses the latest installed version of IE.
After doing some more research, i think i'll stick with the WebBrowser Control. It's not perfect and the posibilities to use own settings are not as good as i hoped, but i think since there seems no better solution, it will have to work...

what are the limitations of wpf web browser control?

What are the limitations of WPF web browser control? Is it good enough for a real-life browser implementation? And is it a fully managed implementation?
The WPF WebBrowser control is just an interop layer hosting the IE ActiveX control. It should be very robust, and usable for a real-life browser (since it's really IE). It is not a managed implementation.
Its main limitations are due to the fact that it's using an HwndHost internally. This means that it has the WPF/Native airspace issues, as well as some minor issues with event handling.
It is good enough for Real-life use, and I agree with Reeds view on the matter.
Additionaly, If a person does not have certain IE files on their computer the control is rendered useless. Here are a few observed limitations I have found:
I have found with the WebBrowser controls is it's hatred of IE6 on a computer whilst trying to perform JavaScript insertions within the control. (Very machine-specific though, so you could say lack of total compatibility?)
The fact that you will need to actually reference the main assemblies of IE to get certain functionality, such as getting something more useful than a HtmlElement.
The lack of support for some of its 2.0 counterparts functions, such as to Suppress Script Errors.
Doesn't work nicely with the WPF layout system
Again due to the fact that its a wrapper for IE, all the compatibility issues in things like CSS stay put, as well as most, if not all the IE issues that exist.
All in all, the control could be greatly improved, and to honest it would be fantastic to see the .NET team make a fully managed version of this component.
Cheers,
Kyle
Adding to the answers by #Kyle and #Reed, below are my observations as limitations.
We can't render PDF in this WebBrowser control.
Underneath engine is IE. We can't replace IE engine with latest Microsoft Edge.

Building an Internet Explorer Extension/Add-On?

I would like to build a browser extension for IE 7/8. I would like to do it using .NET. Do you know of any resources or tutorials that I could reference to do this? I haven't found much.
Thanks!
JP,
One of the main issues that makes IE extensions hard to develop is the need to develop with C, or .NET.
On the other side, FF and Chrome use (to some extent) JS, which is easier, and has a much lower entrance barrier (How many C "web developers" do you know?).
This is one of the issues / obstacle Crossrider is here to solve.
You can create your first IE plugin within minutes. It will save you a lot of research and development time, and you can write your code with Javascript.
On top of that, if you plan this plugin/extension to also work for browsers other than IE then you can develop a cross browser extension once, using an extensive unified API, and we will make it work for Chrome and Firefox.
Chrome and Firefox each one gets a a native extension file (CRX and XPI respectively) while IE a special EXE engine to run your app.
(Disclaimer: I'm a co-founder of Crossrider)
The same question that was asked two years later has the necessary answer. Everyone should refer to this question now:
How to get started with developing Internet Explorer extensions?

Categories

Resources