Skip navigation.

IIS6 Doesn’t Serve Encrypted JavaScript FilesAll recent postsStandards or Quirks?

ASP.NET Adaptive Rendering and Validator Controls

After Scott Mitchell published an article on adaptive rendering I couldn't help wondering what happens to client side validation. You can change the HMTL writer class so server controls would emit the same code for Internet Explorer, Mozilla and Opera, but validators won't work. There's a simple reason for that: Microsoft folks utilize their own proprietary way of referring to controls on a page via document.all ["xxxxx"].

Opera has a user agent setting where you tell it to fake IE, but what's the point? Controls will render validation JavaScript code it won't understand.

Opera&s user agent strings

I guess there are two options at this point:

  • Buy a revamped library of validation controls along with corrected JavaScript code, or
  • Wait until ASP.NET 2.0 ships.

Or... you can settle for client-side validation in IE, and server side validation in all other browsers. But, quite honestly, this is not fun.

Comments

Comment permalink 1 Stefano |
Decompiling System.Web.UI.WebControls of the v.2.0b i'll see that document.all is always present.

protected virtual void RegisterValidatorDeclaration()
{
string str = String.Concat("document.all[\"", base.ClientID, "\"]");
base.Page.ClientScript.RegisterArrayDeclaration("Page_Validators", str);
}

Nothing to wait at this point, just rewrite the controls.
Comment permalink 2 Jesus Barrios |
I don't understand why Microsoft don't support IE WEB Controls currently. What we will do with the developments than used this server controls? What say Microsoft?
Comment permalink 3 Milan Negovan |
To be honest, you're better off not relying on IE web controls. I never liked them. I think they were written more like server control samples. For example, the tree control posts back on every click. Why? Who in sane mind would use a tree that triggers so many roundtrips? Also, their tab control in awful. I don't know if they are committed to even support them.

Emails and Notifications

Would you like to be notified when somebody responds to this post?  Would you like to have these comments emailed to you?

TrackBacks

1 Web Standards Project BUZZ  |   
ASP.Net & Standards Part II

Wow. My post on ASP.Net and standards seems to have touched a nerve. I received a pile of feedback via...

Sorry, TrackBacks are not allowed.

Submit your comment

Please enter only text since all HTML tags except hyperlinks will be stripped. Hyperlinks will become live links. Any comments with flaming or offensive language will be deleted. Be courteous to other posters. Thank you.

Your name (required):
Your email (optional):
Your site's URL (optional):
Enter this number
Type in the number above:
Comment (required):