Showing posts with label maskededitextender. Show all posts
Showing posts with label maskededitextender. Show all posts

Wednesday, March 28, 2012

asp.net Ajax MaskedEditExtender

I am trying to use a MaskedEditExtender in a Gridview, with a Date/Time Template Field.

When i enable the Extender, then when i choose to edit the row, nothing appears. As soon as i Disable the extender than the edit boxes appear.

Any ideas?

<cc1:MaskedEditExtenderID="MaskedEditExtender3"runat="server"MaskType="DateTime"AcceptAMPM="true"

AutoComplete="true"ClearTextOnInvalid="true"mask="99/99/9999 99:99:99"

Enabled="False"TargetControlID="TextBox1">

Hi Kevers,

To see the effect, MaskedEditExtender's Enabled is set to "true". Here is a sample which you can reference to.

<form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager> <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1"> <Columns> <asp:CommandField ShowEditButton="True" /> <asp:BoundField DataField="EmployeeID" HeaderText="EmployeeID" InsertVisible="False" ReadOnly="True" SortExpression="EmployeeID" /> <asp:BoundField DataField="LastName" HeaderText="LastName" SortExpression="LastName" /> <asp:BoundField DataField="FirstName" HeaderText="FirstName" SortExpression="FirstName" /> <asp:BoundField DataField="Title" HeaderText="Title" SortExpression="Title" /> <asp:TemplateField> <ItemTemplate> 2007-10-04 10:20:30 </ItemTemplate> <EditItemTemplate><asp:TextBox ID="TextBox1" runat="server" Text="10/04/2007 10:20:30"></asp:TextBox> <ajaxToolkit:MaskedEditExtender ID="MaskedEditExtender1" runat="server" Mask="99/99/9999 99:99:99" MaskType="DateTime" TargetControlID="TextBox1" AcceptAMPM="true"AutoComplete="true" ClearTextOnInvalid="true" Enabled="true"> </ajaxToolkit:MaskedEditExtender> </EditItemTemplate> </asp:TemplateField> </Columns> </asp:GridView><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:NORTHWNDConnectionString%>" SelectCommand="SELECT [EmployeeID], [LastName], [FirstName], [Title] FROM [Employees]" DeleteCommand="DELETE FROM [Employees] WHERE [EmployeeID] = @.EmployeeID" InsertCommand="INSERT INTO [Employees] ([LastName], [FirstName], [Title]) VALUES (@.LastName, @.FirstName, @.Title)" UpdateCommand="UPDATE [Employees] SET [LastName] = @.LastName, [FirstName] = @.FirstName, [Title] = @.Title WHERE [EmployeeID] = @.EmployeeID"> <DeleteParameters> <asp:Parameter Name="EmployeeID" Type="Int32" /> </DeleteParameters> <UpdateParameters> <asp:Parameter Name="LastName" Type="String" /> <asp:Parameter Name="FirstName" Type="String" /> <asp:Parameter Name="Title" Type="String" /> <asp:Parameter Name="EmployeeID" Type="Int32" /> </UpdateParameters> <InsertParameters> <asp:Parameter Name="LastName" Type="String" /> <asp:Parameter Name="FirstName" Type="String" /> <asp:Parameter Name="Title" Type="String" /> </InsertParameters> </asp:SqlDataSource> </form>

I hope this help.

Best regards,

Jonathan

Wednesday, March 21, 2012

ASP .NET Ajax Validation - MaskedEdit

Hello,

I am using the MaskedEditExtender and the MaskedEditValidator, found good very, however in mine in case that, am needing to make with that it does not use no type of culture in the hour to edit, that is, at the moment where clico inside of the box of text and it appears R$ __.___,__ But, I want that he appears only __.___,__ (Without cultureName="Pt-Br")

Att,

Eduardo Bellinat.

I obtained to make to function, I leave below the explanation:


Not toappear the R$ (cultureName of Brazil) or $ (Culture of the USA), it isnecessary to setar the property MaskType= " None ", of this form willgo, at the moment where to clicar in the box of text, only __. ___.___, __

[]'s,


Eduardo Bellinat.