Andrew Stevenson's WebLog

Write Here Write Now

Syndication

.Net Languages

ADO.Net

Asp.Net (Misc.)

Asp.Net Controls

Bad Patterns

Err What?

Files and Folders

Forums

IE Add-Ins

Methods for the Madness

Performance

See Clearer, C#

Test Driven

NUnitAsp and style="display: none"

I have a control, which I test with a customvalidatortester, that produces an html span with (I thought) style="display:none" and it was failing the test for visible==false.

A closer inspection showed that there was a space after the colon:   style="display: none"

Removing the space fixes the problem, but the root of the problem is where the space comes from. The space is inserted when I use Visual Studio 2005's format document on the aspx markup.

To solve this, I mad another small change to NUnitAsp.

In ValidatorTester, I chanbed the visible property to check for both versions.

                bool displayNone = (style != null && (style.IndexOf("display:none") != -1 || style.IndexOf("display: none") != -1));

 

Published Wednesday, February 13, 2008 11:32 AM by AndrewSeven

Comments

No Comments