Making my ASP.NET website compatible with Firefox? - c#

I have an ASP.net website ( http://www.erate.co.za ) version 2.0.
When someone opens my website in Firefox everything looks different.
Why is that and how can I make it compatible?
Please help!
Etienne

The problems don't have anything to do with ASP.NET / C# Specifically.
They have to do with your understanding of web design / HTML / CSS and how you can make a cross-browser compatible UI.
I'd suggest you look at http://www.w3schools.com/ for some information on good web design practices.
Some obvious problems with the Source that you need to address are
No common css Stylesheets
Styles are applied inline on lots of elements
using long strings of " " to align text

The underlying server technology should not have any impact on your websites appearence as long as you are just producing HTML.
What you need to do is make sure that your HTML and CSS works as intended in all browsers. A good way to start is to make sure that you only output standards compliant code.

The issue at hand is that styles that you are using don't work in firefox such as cursor:hand; versus cursor:pointer; both work in IE but only pointer works in firefox. A quick recommendation would be to just run the resultant page through the w3c validator located at: http://validator.w3.org/

Per se, ASP.NET produce vanilla HTML/Javascript, so there's nothing wrong with the technology.
Focus on the html, try to be as close as possible to the w3c standards, it should help a lot.
Firebug, an incredible web dev extension for Firefox should also help you a lot in debugging your CSS.
It might be a painful task, especially if your site is old and big. Good luck!

Related

How to minify and combine Javascript and CSS

Can someone give me pointers on how I can minify and combine my CSS as the site I'm working on has performance issues. Also, are external JS and CSS libraries also minified and combined or left as is?
There are several convenient options for .NET, for example:
Chirpy
SquishIt
Cassette
And new in ASP.NET 4.5:
Bundling in ASP.NET 4.5
I'd recommend reading Google's Page Speed and their Closure Compiler Service.
I would also add RequestReduce for .net options. It may be the only runtime bundling option for minifying external resources. Its unique from the other .net options in that it grabs the unminified content via http instead of via the file system. It can also sprite your background images.
I know this is an old question but I thought I will give a better answer (trick).
In visual studio if you do format code (Ctrl + K + D) then css will be formatted nicely for you.

.Net HTML Editor Control

I need to add in a WYSIWYG control into a .NET form. I found this one from SpiceLogic on several sites and was wondering if this is a decent library to use?
http://www.spicelogic.com/Products/NET-Win-HTML-Editor-Control-8/
If anyone has any additional input, I also would like to know of any other decent alternatives, both free and non-free.
Thanks in advance for any opinions on this!
EDIT Should have clarified this before, but this is a desktop application.
You can also try one of these strategies:
Use the RichTextBox control, which exposes a FlowDocument. Write a program that converts the FlowDocument to HTML. Since FlowDocs are much more constrained that HTML, this conversion might be pretty straightforward (sections -> div, paragraph -> p, styles -> css or style attributes, etc).
Use MSHTML and put it into edit mode. http://msdn.microsoft.com/en-us/library/aa753622(v=vs.85).aspx
You may want to try XStandard. I have used it in CMS web sites and it works great. You can also use it with desktop apps. There is a free "lite" version and a for=pay pro version. It creates XHTML markup and has lots of slick built-in functionality.
As a comparison, I have used Telerik RAD Editor and XStandard is much better (IMO). I have also tried other web-specific solutions like FCKEditor and TinyMCE and I prefer XStandard.
If your concern is to get XHTML all the time right from the beginning which should be published on the Web, then, I would say, "Yes", you can try that component from SpiceLogic, especially the version 5.x which was released very recently. It comes with many features like embedding images for an email client, Uploading local images to FTP, paste from MS Word, rich Dialogs for Tables, Images, Hyperlink, Symbols, Inline Spell Checker and Spell Checker dialogs, and more.
https://www.spicelogic.com/Products/NET-WinForms-HTML-Editor-Control-8
All Screenshots:
http://www.spicelogic.com/Products/NET-WinForms-HTML-Editor-Control-8/Screenshots
TinyMCE is a great way to achieve this. Here is a way to embed TinyMCE in Winform. I tested it and it works pretty well: https://github.com/Rocker93/winforms-html-editor
An other solution is CEFSharp. The integration is not easy but it's very well documented and it's the most powerful and free solution I have found.
At work we use telerik controls for this stuff:
http://www.telerik.com/products/aspnet-ajax/editor.aspx
its definitely not free though.

How to minify aspx pages

I am developing a web-based Pokemon Online game. Since it is online, I would like to optimize it to run as quickly possible.
I've installed Firebug and Page Speed suggests minifying my HTML output. I'm also using VS2008, ASP.NET 3.5, AJAX, and IIS 7.5; along with URL-Rewriting.
I want to minify my HTML, JavaScript, and CSS. Optimally, I'd like the minifying process to happen at compile time. I've spend hours looking online but couldn't find a decent solution, can you help me? Thank you.
Firstly, you should read the Yahoo best practices for speeding up webpages.
You will probably find that minifying the HTML won't have much difference (also see this question), but a lot of the other suggestions in that article will.
There are a couple of methods to achieve this. You can configure GZip compression with IIS7 if you have access. If you don't i.e. you are using a hosting provider it is possible to activate compression from within your code.
See this SO Post for further reading.
UPDATE:
To perform this at build time rather than run time see this blog post.
Instead of minifying your .aspx files consider dynamic compression. This will send compressed data to the browser. since you are using IIS 7.5 dynamic compression comes built-in you just have to enable it.

scraping/simulate browsing help

I want to make a program that will simulate a user browsing a site and clicking on links. Cookies and javascript have to be enabled. I've successfully done this in python, but I want to write it an compilable language (python ide's don't cut it). The links on the site are generated with javascript and are dynamic. With python I used PAMIE (third party module that uses win32com) to launch an instance of Internet explorer, scrape the generated html for the links, then navigate to one of them. The point is for the whole process to be transparent to the server. What's the best (compilable) language and method to do this? I was thinking C# with WebBrowser control but I don't want to spend a lot of time learning something if it isn't going to work. Any kind help is appreciated!
You might want to look at the automated testing via browser suites:
http://www.teknologika.com/blog/the-holy-grail-net-automated-web-gui-testing-for-internet-explorer/
http://watin.sourceforge.net/
I wrote a blog post on this awhile back: Web scraping in .NET. That discusses cookies but not JavaScript; I don't know if that would require additional coding.
Might be worth having a look at selenium .
We use it for web testing in a C# asp.net envirnorment.
The documentation isn't to bad

Using FLASH with ASP.NET - YAY or NAY?

I know i can use AJAX and SILVERLIGHT with my ASP.NET web page. But what do you think about using flash with asp.net? Can this be done? How can this be done? Would you recommend me using flash at all with ASP.NET? I will NOT be using WEB SERVICES, just a plain ASP.NET website.
Thanks in advance!
EDIT: What about performance issues???
I have used Flash in ASP.NET websites plenty.
Software should always boil down to the best tool for the job, if Flash is the way you need to go for your RIA, then so be it.
Remember, ASP.NET is nothing "new/different" ultimately, it is just a fancy HTML generator.
Therefore, to use flash, you simply use the plain old HTML OBJECT and EMBED tags to place the Flash on the page.
The benefit of using things like ASP.NET (or any other framework) is that you can encapsulate the EMBED logic to use things like swfObject.
flash is client side, what you use server side has very little impact on it.
Given Flash's high market penetration (98%+), I think Flash is a great way to go regardless of the underlying platform.
But, as with everything, it depends on what you want to do. If you want to deliver a rich user interface via Flash, you should consider using Flex.
There are several tools to help integrate a Flash/Flex application with ASP.NET. One of these that I recommend is WebORB.
It certainly can be done! We've done entire flash-based websites in the past that rely on data generated by a CMS and read from flash via XML. There are of course lots of gotchas (loading html text, multilingual characters), but once you've done it a few times you'll get the hang of it.
Flex is probably a better option.

Categories