在单击按钮后的webpart中,应显示日历,并在选择日期后,应在文本框中显示特定日期 [英] in a webpart after the button is clicked a calender should appear and after a date is selected that particular date should be displayed in the textbox
问题描述
在单击按钮后的webpart中,应显示日历,并且在选择日期后,应在文本框中显示特定日期
in a webpart after the button is clicked a calender should appear and after a date is selected that particular date should be displayed in the textbox
推荐答案
<asp:calendar id="Calendar1" runat="server" xmlns:asp="#unknown">
onselectionchanged="Calendar1_SelectionChanged"></asp:calendar>
protected void Calendar1_SelectionChanged(object sender, EventArgs e)
{
var dt = Calendar1.SelectedDate.ToShortDateString();
TextBox1.Text = Convert.ToString(dt);
}
在日历控制的Day_Render事件中编写代码。工作正常。
折叠|复制代码protected void Calendar1_DayRender(object sender,DayRenderEventArgs e)
{
TextBox1.Text = Calendar1.SelectedDate.ToString();
}
只是尝试这个逻辑
Write the code in Day_Render event of calender control.Working fine.
Collapse | Copy Code protected void Calendar1_DayRender(object sender, DayRenderEventArgs e)
{
TextBox1.Text = Calendar1.SelectedDate.ToString();
}
just try out this logic
使用jQuery http://jqueryui.com/datepicker/ [ ^ ]如果它不是一个sharepoint形式
Use jQuery http://jqueryui.com/datepicker/[^] if its not a sharepoint form
这篇关于在单击按钮后的webpart中,应显示日历,并在选择日期后,应在文本框中显示特定日期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!