Tech Off Thread

5 posts

Forum Read Only

This forum has been made read only by the site admins. No new threads or comments can be added.

ASP.NET Form validation

Back to Forum: Tech Off
  • User profile image
    phunky_avoc​ado

    The built-in .NET validators only work in browsers that support ECMA Script 1.2 or greater and the Microsoft DOM.  The former makes sense but the latter kinda sucks. 

    I created a bunch of validators that override the normal ASP.NET validator visible behaviours (I do more than just put a red message on the client).

    I need to be able to validate when the user is using Netscape Navigator 7.2.  It's the Microsoft DOM requirement that is getting in the way.  Anyone know how to trick ASP.NET to think the browser is "uplevel" when according to Microsoft it is not?

    Thanks.

  • User profile image
    themaffeo

    Something along these lines should work:

    <untested>
    If Request.Browser.Browser = "(useragent)" Then

       Me.ClientTarget = "uplevel"

    End If
    </untested>

    Good question though, I think I'll futs around with this and blog about it tonight.

  • User profile image
    phunky_avoc​ado

    Thanks for the reply.  Upon further investigation I found that the scripts in WebUIValidation.js use method and property calls that are only valid in MS DOM.  E.g., there are a lot of "document.all[...]".  So I have to create a new version of WebUIValidation.js that works outside of MS DOM.  Sad

    So tricking the framework to think a downlevel browser is an uplevel browser won't work unless I modify the scripts.


    themaffeo wrote:

    Something along these lines should work:

    <untested>
    If Request.Browser.Browser = "(useragent)" Then

       Me.ClientTarget = "uplevel"

    End If
    </untested>

    Good question though, I think I'll futs around with this and blog about it tonight.

  • User profile image
    sbc

    Vote for this suggestion on the MSDN Labs site: Client Side Validation and this bug: asp:Menu control only works in IE if you wish ASP.NET 2.0 to be nicer with other browsers.

  • User profile image
    sbc

    Check out this 4Guys article as well: Client-Side Validation in Downlevel Browsers

Conversation locked

This conversation has been locked by the site admins. No new comments can be made.