[Mono-dev] Validator controls expected results?

Dieter Bremes dbjobs at snafu.de
Wed Jan 4 18:27:17 EST 2006


Christopher Bergström wrote:
> Dieter Bremes wrote:
> 
>> Christopher Bergström wrote:
>>
>>> Per the documentation.. If I have display="None" and a 
>>> <asp:ValidationSummary /> control then the validator control should 
>>> not display results inline, but the JS still executes.  I found a 
>>> work-around by EnableClientScript="false".. bug?
>>>
>>> This is in Firefox latest version.. (Haven't tested in Safari, IE, 
>>> Opera.. etc..)
>>>
>>> This works as expected..
>>>
>>> Example :
>>> <asp:requiredfieldvalidator id="valPhone" runat="server"
>>>        Controltovalidate="txtPhone"
>>>        Display="None"
>>>        EnableClientScript="false"
>>>        Errormessage="Please enter a phone number." />
>>>
>>> <asp:ValidationSummary id="vsResults" runat="server"
>>>   DisplayMode="List"
>>>   EnableClientScript="false"
>>>   ShowSummary="true"
>>>   ShowMessageBox="true"
>>>   HeaderText="Results" />
>>>
>>>
>>> If possible can someone send me the actual html output that MS .Net 
>>> produces and I'll see if I can make a patch.. I'd also like to see 
>>> the actual html produced in the summary control with DisplayMode="" 
>>> being changed to each option.. List, BulletList, SingleParagraph
>>>
>>> In my patch should I not change the elements to xhtml compliant?
>>>    example : <br> to <br />
>>>
>>> Thanks
>>>
>>> C.
>>> _______________________________________________
>>> Mono-devel-list mailing list
>>> Mono-devel-list at lists.ximian.com
>>> http://lists.ximian.com/mailman/listinfo/mono-devel-list
>>>
>>
>> Hi Christopher,
>>
>> .NET 1.1 works as expected + documented. I've attached four files:
>> - FF_LX_NoJS.txt: EnableClientScript=False for both validators
>> - FF_LX_NoJS_AfterValidate.txt: HTML after validation
>> - FF_LX_JS.txt: EnableClientScript=True for both validators
>> - FF_LX_JS_AfterValidate.txt: HTML after validation
>>
>> All files were produced using
>> - VS.NET 2003 / .NET Framework v1.1.4322 + W2K server side
>> - IE 6.0 + W2K client side (same machine)
>>
>> I also tried Firefox 1.07 + SUSE 10 OSS client side, HTML looks the same.
>>
>> Let me know if that's what you need. I will then send results for 
>> different DisplayMode values.
>>
>> I would not change the elements to xhtml compliance because this 
>> should be compatible with MS' output. They claim to be compliant in 
>> ASP.NET 2.0.
>>
>> Dieter
>>
> Just to confirm.. Firefox does work as expected for you?

Yes. I've checked it again and attached 8 files:
- FF_LX_ now really means Firefox 1.07 + SUSE 10 OSS
- IE_Win_ means IE 6.0 + W2K (same machine)

The initial descriptions regarding the environment were correct, but I 
misnamed the files.

Comparing the IE_ and FF_ files + googling shows that only IE 5+ 
versions get client side JavaScript code. MS calls everything else a 
downlevel browser and doesn't send JavaScript regardless of 
EnableClientScript's value. This adds a roundtrip but doesn't affect the 
display.

BTW: validation will occur on the server anyway. Otherwise someone could 
send a faked HTTP POST, so even with IE 6 and EnableClientScript=True 
the server will validate the input.

> 
> Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.12) Gecko/20051215 
> Firefox/1.0.7 The only thing I could consider that might be causing some 
> abnormalities would be my plugins, but it's never been an issue before..
> 
> As far as changing the output I have a pretty good understanding on how 
> to make things xhtml compliant and also not breaking older clients.  
> Quick worthless tidbit.. The <br> tag is in not proper xml/xhtml.. if 
> you change the tag to <br/> You'll break older clients, but there is a 
> work-around <br /> with the space works.. As far as the javascript.. 
> I've been giving some thought as to how to move it to an external file 
> as it should be.. Probably include make a temp file and bla bla.. Not 
> sure the performance impact or many things with this.. (Assuming a 
> strict xhtml approach)
> 
> There would be zero functionality difference and would really only be a 
> difference if you're parsing the raw html output and searching for those 
> non compliant elements..

In my opinion Mono should be as .NET compliant as possible. One reason 
is that this makes testing much easier. Another one would be that 
HttpModules and the like may rely on .NET's (buggy) behaviour.

But that's just my opinion and I can in no way decide this.

Dieter

> 
> As far as 2.0 being compliant.. I wonder which DTD(s) they claim to 
> validate against.. I have to look into this.. I'll find out tonight..
> 
> Thanks a lot!
> 
> C.
> _______________________________________________
> Mono-devel-list mailing list
> Mono-devel-list at lists.ximian.com
> http://lists.ximian.com/mailman/listinfo/mono-devel-list
> 



-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: IE_Win_NoJS_AfterValidate.txt
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060105/54a70125/attachment.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: FF_LX_JS_AfterValidate.txt
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060105/54a70125/attachment-0001.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: FF_LX_NoJs.txt
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060105/54a70125/attachment-0002.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: FF_LX_NoJs_AfterValidate.txt
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060105/54a70125/attachment-0003.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: IE_Win_JS.txt
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060105/54a70125/attachment-0004.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: IE_Win_JS_AfterValidate.txt
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060105/54a70125/attachment-0005.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: IE_Win_NoJS.txt
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060105/54a70125/attachment-0006.txt 
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: FF_LX_JS.txt
Url: http://lists.ximian.com/pipermail/mono-devel-list/attachments/20060105/54a70125/attachment-0007.txt 


More information about the Mono-devel-list mailing list