Main Page | Report this Page
.NET DotNet Forum Index  »  ASP.NET Forum  »  MaskedEditExtender with existing...
Page 1 of 1    

MaskedEditExtender with existing...

Author Message
David C...
Posted: Mon Nov 02, 2009 5:59 pm
Guest
I am trying to use the Ajax toolkit control MaskedEditExtender. I find that
when I use it on a control that already has a date in it the date goes away
in edit. Can I make it so that the date and time that is already bound
shows up in the mask? Below is what I am using in my GridView. Thanks.
David

<asp:TemplateField HeaderText="Start Time"
SortExpression="StartTime">
<EditItemTemplate>
<asp:TextBox ID="txtStartTime" runat="server"
Text='<%# Bind("StartTime") %>'></asp:TextBox>
<cc1:MaskedEditExtender ID="MaskedEditExtender1"
runat="server" AcceptAMPM="True"
TargetControlID="txtStartTime"
MaskType="DateTime" Mask="99/99/9999 99:99">
</cc1:MaskedEditExtender>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="LblStartTime" runat="server"
Text='<%# Bind("StartTime", "{0:h:mm tt}") %>'></asp:Label>
</ItemTemplate>
</asp:TemplateField>
 
Alexey Smirnov...
Posted: Thu Nov 05, 2009 8:48 am
Guest
On Nov 2, 11:59 pm, "David C" <dlch... at (no spam) lifetimeinc.com> wrote:
Quote:
I am trying to use the Ajax toolkit control MaskedEditExtender. I find that
when I use it on a control that already has a date in it the date goes away
in edit.  Can I make it so that the date and time that is already bound
shows up in the mask?  Below is what I am using in my GridView.  Thanks.
David

                <asp:TemplateField HeaderText="Start Time"
SortExpression="StartTime"
                    <EditItemTemplate
                        <asp:TextBox ID="txtStartTime" runat="server"
Text='<%# Bind("StartTime") %>'></asp:TextBox
                        <cc1:MaskedEditExtender ID="MaskedEditExtender1"
runat="server" AcceptAMPM="True"
                                TargetControlID="txtStartTime"
MaskType="DateTime" Mask="99/99/9999 99:99"
                        </cc1:MaskedEditExtender
                    </EditItemTemplate
                    <ItemTemplate
                        <asp:Label ID="LblStartTime" runat="server"
Text='<%# Bind("StartTime", "{0:h:mm tt}") %>'></asp:Label
                    </ItemTemplate
                </asp:TemplateField

Hi David,

please look at the following example, I think this is exactly how you
want to do this
http://www.obout.com/grid/grid_integration_ajax_toolkit.aspx

Hope this helps
 
 
Page 1 of 1    
All times are GMT - 5 Hours
The time now is Thu Dec 03, 2009 7:48 am