Archive

Archive for May, 2008

Validation – Its just too easy


Yes, I know we have been using this stuff for years but its still a buzz to use instead of custom javascript.

<asp:CompareValidator id=”someID” ControlToValidate=”someControl”
ControlToCompare=”someControl” or ValueToCompare=”someValue”
Type=”Currency|DateTime|Double|Integer|String”
Operator=”DataTypeCheck|Equal|GreaterThan|GreaterThanEqual|LessThan|LessThanEqual|NotEqual”
Display=”Dynamic|None|Static”
ErrorMessage=””
runAt=”server” >
ErrorMessage (e.g. “*”)
</asp:CompareValidator>

<asp:RequiredFieldValidator id=”someID” ControlToValidate=”someField”
Display=”Dynamic|None|Static”
ErrorMessage=”some error message”
RunAt=”Sever”>
ErrorMessage (e.g. “*”)
</asp:RequiredFieldValidator>

<asp:RangeValidator id=”someID” ControlToValidate=”someControl”
MaximumControl=”someControl”
MinimumControl=”someControl”
MaximumValue=”someValue”
MinimumValue=”someValue”
Type=”Currency|DateTime|Double|Integer|String”
Display=”Dynamic|None|Static”
ErrorMessage=”some error message”
RunAt=”server” >
ErrorMessage (e.g. “*”)
</asp:RangeValidator>

<asp:RegularExpressionValidator id=”someID” ControlToValidate=”someControl”
ValidationExpression=”some expression”
ErrorMessage=”some error message”
Display=”Dynamic|None|Static” >
ErrorMessage
</asp:RegularExpressionValidator>

<asp:CustomValidator id=”someID” ControlToValidate=”someControl”
onServerValidation=”someFunctionThatReturnsABoolean”
ClientSideValidation=”someFunction”
ErrorMessage=”some error message”
Display=”Dynamic|None|Static” >
ErrorMessage (e.g. “*”)
</asp:CustomValidator>

<asp:ValidationSummary id=”someID”
Showsummary=”True|False”
DisplayMode=”BulletList|List|SingleParagraph”
HeaderText=”some text”
RunAt=”server” >
</asp:ValidationSummary>

Advertisements
Categories: C# Code Comments

USB Drives Letters


My USB flash drive went AWOL after I added a new USB hard drive.

When a USB drive is first attached, Windows allocates it the first available drive letter even if the letter is an existing network share. This is because XP network shares are specific to the current user and not visible in the context of the system where the letter is assigned. The USB drive then appears to be invisible.

The resolution is to give the flash drive a new drive letter i.e.

1. Right click My Computer then Manage
2. Select Disk Management
3. Right click on the troublesome USB disk
4. Use Change Drive Letter and Paths to give it a new drive letter

If you are still getting grief have a look here for a tool to help you manage your USB drive allocations.

And one more thing since I first posted this .. there is a limitation to what drive letter you can assign a USB drive to … its around F(ish).

Categories: New Posts, Ramblings