Showing posts with label format. Show all posts
Showing posts with label format. Show all posts

Monday, March 26, 2012

My .aspx lost his format when I change a property on design mode

Hello,

I've just updated my project to the new ajax beta 1.

Everything looks fine, but when I make some change on my pages in design mode, the aspx source code lost completly the previous format.

Somebody could help me.

Thanks,

Rodrigo Sendin

Hello Ajax Guys,

I think my problem is related with an issue posted by "tschlarm" today (Beta 1 issues). I am working with Master Pages and I used to work in Design mode. After beta 1 I am having problems with the format of the aspx source code. (the source code format is totally changed when I work in Design)

I´ve modifed my web.config in order to change the tagPrefix of ajax controls (from asp to ajax), and the problem has stoped. My web.config was changed to:

<addtagPrefix="ajax"namespace="Microsoft.Web.UI"assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<addtagPrefix="ajax"namespace="Microsoft.Web.UI.Controls"assembly="Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

<addtagPrefix="ajax"namespace="Microsoft.Web.Preview.UI"assembly="Microsoft.Web.Preview"/>

<addtagPrefix="ajax"namespace="Microsoft.Web.Preview.UI.Controls"assembly="Microsoft.Web.Preview"/>

Thanks,
Rodrigo Sendin

Wednesday, March 21, 2012

Need help with regex for Phone Validation for MaskedEditExtender Control

I'm needing some help in getting maybe a regex to work with the format I've put into my MaskedEditExtender control. So far I have this but need a little help in figuring out how to get the correct validatoni in here. I assume I must set the MaskType to none when establishing a custom validation expression in the MaskedEditValidator control.

 
<tr> <td align="right" width="220px"><asp:Label ID="lblPrimaryContactPhone" runat="server" /> <td align="left" valign="middle"> <asp:TextBox ID="TextBox1" runat="server" Width="180px" ValidationGroup="MKE" /> <cc1:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="TextBox1" Mask="(999) 999-9999" MessageValidatorTip="true" OnFocusCssClass="MaskedEditFocus" OnInvalidCssClass="MaskedEditError" MaskType="None" ErrorTooltipEnabled="True" /> </td> <td align="left"><asp:TextBox ID="txtPrimaryContactPhone_Area" runat="server" /></td align="left"><td>-</td><td align="left"><asp:TextBox ID="txtPrimaryContactPhone_Prefix" runat="server" /><td>-</td><td align="left"><asp:TextBox ID="txtPrimaryContactPhone_Suffix" runat="server" /></td> </tr><tr> <td align="right"> <cc1:MaskedEditValidator ID="MaskedEditValidator1" runat="server" ControlExtender="MaskedEditExtender6" ControlToValidate="TextBox1" IsValidEmpty="False" EmptyValueMessage="phone is required" InvalidValueMessage="phone format is invalid" Display="Dynamic" TooltipMessage="" InvalidValueBlurredMessage="" ValidationGroup="MKE" ValidationExpression="/^\(?[2-9]\d{2}[\)\.-]?\s?\d{3}[\s\.-]?\d{4}$/" /> </td></tr>

HI There,

Im assume the format that you after is like follow:

1) first character range from 2- 9 folow by 2 digit

2) follow by 3 and 4 digit

If this is what are you trying to do

You regularexpression seem to be alright, all you need to remove is "\" sign

ValidationExpression="^\(?[2-9]\d{2}[\)\.-]?\s?\d{3}[\s\.-]?\d{4}$" />

^ = startwith

$ = endwith

Hope this is help