开发者

calendar format using ajax

When I am using ajax calendar it is a taking date in the format 07-17-2010 but I want the format as 07/17/2010. This means instead of - (hyphen) I want /(slash). Can we change this? If开发者_运维百科 yes then how can we do this? Please help me.

my code is

<asp:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
</asp:ToolkitScriptManager>

<asp:TextBox ID="txtstart" runat="server" Width="200px">
</asp:TextBox>
<asp:ImageButton ID="ImageButton1"
        runat="server" ImageUrl="~/images/icon_cal.png" />
<asp:CalendarExtender runat="server" TargetControlID="txtstart"
        Format="mm-dd-yyyy" PopupButtonID="ImageButton1">
</asp:CalendarExtender>


Is the format supposed to be:-

MM-dd-yyyy

notice the uppercase MM, see this post from MSDN to get a list of valid format strings

Edit The question has changed since I gave my initial answer. Can the format now be

MM/dd/yyyy


I was thinking it was a format like this but apparently not..

Maybe transform the value into a string and use string.replace..

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜