Question : Ajax Maskededitextender remove mask on postback

I am using the MaskedEditExtender on a textbox for a Time field:

<ajax:MaskedEditExtender ID="MaskedEditExtender2" runat="server" TargetControlID="txtEnrollmentTime" MaskType="Time" Mask="99:99 (24hr)" ClearMaskOnLostFocus="false">
</ajax:MaskedEditExtender>

Everything works the way I want until I submit the form and try to put the value into the database.
Before I added "ClearMaskOnLostFocus="false"", the value would be in time format and go into the database nicely. That is the way I would like to store it in the database, but for UI reasons, I needed to keep the mask in the box whether within focus or not. Now, I have to add several lines of code before running the function to enter into the database, just to get rid of the (24hr) and if nothing entered, or part-way entered get rid of the "_".

I have the same problem with the phone number field and mask:

<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" MaskType="Number" Mask="(999)999-9999" TargetControlID="txtPhone" ClearMaskOnLostFocus="false"  >
</ajax:MaskedEditExtender>

Is there a better way of doing this without going through all my pages and checking the text of these fields before going to the database?

Thank you in advance

Answer : Ajax Maskededitextender remove mask on postback

Is there a better way of doing this without going through all my pages and checking the text of these fields before going to the database >>>>>>>>>>>

If you are using ClearMaskOnLostFocus="false" and you want it to be saved it without the mask in DB, then you will have to manually remove the characters in the code-behind before going to DB
Random Solutions  
 
programming4us programming4us