Friday, July 31, 2009

Browser choice in a Government and Big Business


I'm a web developer and have been for years both private and now public sector. IE is the corporate standard that we use, again for the save reasons. The biggest different isn't in comparing IE to Firefox it's all about versions.



IE6 is barely a web browser, it follows very few standards it's dealing with IE 6 users takes far too much time from any web developer. The JavaScript is an old version from 2000 and doesn’t support a lot of new features, AJAX is basically a hack for IE6 If you are running this upgrade, please.



IE7 is a little more standard but is still circa 2003 for its implementations so a lot of new features aren't implemented. Web developers tend not to rely on these features so IE7 is an ok baseline. It still has a few oddities but only when you try something tricky. It’s JavaScript is from 2003 and is much faster that IE6 but still very slow.



IE8 is the first IE browser I’m not frustrated to use. Depending on how it’s feeling it can be standards compliant and render modern web pages according to the w3c standards. It has it’s bugs but I’d say it’s almost as good as Firefox 3.0, for the type of people that don’t adjust settings IE8 is a great browser, I strongly suggest you upgrade to it, after you’ve tested it. Some applications
written for IE6 only might not work. IE does not support canvas (explained later).



Firefox 1 and 2 are just old , don’t use them, well don’t use anything but 3.5.1 or newer (patch expected soon).



Firefox 3.0 is equivalent to
IE8 in most respects. It has more addons and can be customized more but in a corporate environment I don’t see why most users would need it. It is slightly faster than IE8 in Javascript.



Firefox 3.5 uses a new javascript engine
that is much faster than anything listed above, That’s pretty much it. If you are going to run firefox this is the best version but as stated it’s not as easy to catch in an organization.




Opera , they have implemented the standards better than any other browser, and have for years. No one really cares.



Safari (mac and windows, by apple), It has good support for html5. This is a new web tech that does allows things like a web page to generate images on the fly a great example of this is a form that you fill out and it generates a chart based on the data without ever using the server or internet.
Html5 has a lot of other neat features such as caching data on the client, so they can access it faster and you spend less money on servers.
This is also the browser used by those trendy kids with the iPhones.



Chrome (by google),
does javascript fast, and I mean really fast, often over twice the speed of IE 8 and comparing it to IE6, well that just isn’t fair. It supports a lot of html5 and it makes it possible for a good web developer to write applications that run as fast as a desktop application with all the features but without the need to ever install or patch (as they are web apps and you just browse to them).



To get some ideas of what a fast web browser can do check out http://www.chromeexperiments.com/ it won’t work at all in IE, even IE8 sadly but in chrome (or most other browsers) it will show of some of the power of the browser.



To sum it all up the best browser is IE8, it’s slow and has less features but it’s easy to patch. This is unless you want your developers to start taking advantage of the new features.

Thursday, May 21, 2009

One Step at a time - Changing a password

If in asp.net you want to change a password but don't know the current password you need to generate a new one and use it to change the password. So to change a users password to "abc123"

MembershipUser mUser = Membership.GetUser(username);
string tmpPassword = mUser.ResetPassword();
bool PassswordChanged = mUser.ChangePassword(tmpPassword, "abc123");
because
mUser.SetPassword( "abc123");
Just didn't makes sense. Don't tell me what to do I'll write my own policies.

Friday, May 15, 2009

Well that’s weird – hidden validation controls

This is the first of a hopefully regular column. In it I’d like to cover weird bits of code that just don’t make sense and I haven’t seen elsewhere but are required to make something work. It is my hope that others can learn from my pain.

Today I’m going to cover server validation. Asp.net has a very handy custom validation control that can be used to check values preventing things like duplicates in a database. I won’t go into it as more information can be found here

http://www.4guysfromrolla.com/articles/073102-1.aspx

My issue came in that I have three groups of controls. Group one, two and a general group. The button you clicked determined if group one or two was validated but the rest where validated with a line of code like this.

Page.Validate("general");

This worked great until I decided that I should hide my form by default and show it only if needed.

panForm.Visible = false;

With the panel containing the control hidden when I called Validate(“general”) it preformed no validation. This is because although the control existed asp.net assumed it was not to be used as it was hidden. My eventual solution was to get the hidden state of the panel and unhide it then rehide it.

bool formVisibility = panForm.Visible;
panForm.Visible = true;
Page.Validate("general");
panForm.Visible = formVisibility;

One Problem solved, many more to come.

Sunday, February 15, 2009

Google OpenID

There was talk about Google working with openID but no one I knew knew how to use it so after a little research and a fair bit of testing I found this http://code.google.com/apis/accounts/docs/OpenID.html It tales about how to setup Google login for your site. It recommends that you implement a special login with Google button but it gives a nice URL of https://www.google.com/accounts/o8/id.

Now thats all and good but I found it a little hard to remember so. I created a tiny URL. Now all you have to rememeber id googid and you can login to any OpenID site.

http://tinyurl.com/googid

I will be implementing this on Tuesday let people use Google accounts on our site.