views:

180

answers:

2

Hi there!

I'm using AjaxControlToolKit for an application and I'm using the MaskEditExtender on a TextBox. This TextBox will be use to get something like an IP address (I.E.: 999.999.999.999 OR 999.999.999.*).

I've no difficulty to make the first one (999.999.999.999) but how can it also allow the * instead of the 999? Is it possible?

Thanks to help me!

A: 

Perfect i found it! Here's my Maskeditextender.

<cc1:MaskedEditExtender ID="MaskedEditExtender1" runat="server" ClearMaskOnLostFocus="False" ClearTextOnInvalid="True" Filtered="N'*'" Mask="999.999.999.NNN" TargetControlID="MyTextBox" />
Simon
+1  A: 

Sorry this doesn't help, but thought I should point out that the maximum value for any octet in an IPv4 address is 255.

Its also somewhat incorrect to use * as a wildcard. You would probably be better asking for a network mask (which is another dot quaded field). Its incorrect to assume that there are 255 hosts within a class C subnet for example.

There is a good article on subnetting and network masks on Wikipedia/Subnetwork

PaulG
Yeah I understand! Thanks for the reply. But thats why i've said "An IP like" ... it used a regex like : "[1-9]{3}.[1-9]{3}.[1-9]{3}.[1-9]{3}.". Sorry, the title of my post not good (I thought i've change it). It's an "internal code" for a compagny, it's like a unique ID for them for their computer (Why they don't use the ip address ... I don't know :P).
Simon