如何在回发时在ajax日历控件扩展器中保留日期值 [英] How to retain Date value in ajax calendar control extender on Postback
问题描述
亲爱的朋友,
我在Web窗体中使用一些日期控件(例如,开始日期和结束日期)与Ajax日历扩展程序一起使用,
但是以某种方式在DropDown回发事件中,Date控件内的值丢失了,我不得不再次重新输入该值,这对每个用户而言都不好.
而且我也不希望用户编辑日期控件仅选择特定的日期...因此应将其读取为Only(non-Editable).
请回复,
问候,
Aamir
Dear Friends,
i am using some date controls like start Date & End Date in my Web Form with Ajax Calendar extender,
but somehow on DropDown Postback event the value inside the Date controls gets lost and i have to re-enter the value again which is not good as per User.
and also i dont want user to edit the date controls only select the particular Date...so it should be read Only(non-Editable).
Pl reply,
Regards,
Aamir
推荐答案
只需在目标控件(即文本框)中添加以下属性即可.
Hi,
Just add the following property in your target control i.e. Textbox.
1. ViewStateMode ="Enabled"
2. EnableViewState ="true"
1. ViewStateMode="Enabled"
2. EnableViewState="true"
祝一切顺利.
--Amit
All the best.
--Amit
按以下方式使用Ajax Calender Extender Controller ...在回发页面后,它永远不会丢失值
use Ajax Calender Extender Controller following way...its never loose value after post back of page
<asp:TextBox runat="server" ID="MyTextBoxFromDate"></asp:TextBox>
<ajax:CalendarExtender ID="MyTextBoxromDateCalendar" TargetControlID="MyTextBoxFromDate"
Format="dd/MM/yyyy" runat="server" />
<ajax:MaskedEditExtender ID="MaskedEditExtender1" runat="server" TargetControlID="MyTextBoxFromDate"
MaskType="Date" InputDirection="LeftToRight" MessageValidatorTip="true" Mask="99/99/9999">
</ajax:MaskedEditExtender>
您可以根据需要在所有控件上方添加其他必需属性...我仅使用了基本必需属性
you may add others required properties in above all controls as you your need...I have use just basic required properties
这篇关于如何在回发时在ajax日历控件扩展器中保留日期值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!