我有2个文本框。
在第一个文本框中,用户通过在asp.net中使用日历控件来选择日期。
在textbox1中添加所需日期后,我将不再添加10个月并自动在textbox2中显示日期。
在textbox1
例如:textbox1:19/12/2013 then after selecting this date, then textbox2 automatically fill with like textbox2:19/10/2014
请帮帮我
答案 0 :(得分:0)
只需使用html5
<input type="date">
简单明了
了解更多信息
http://www.w3.org/TR/html5-author/common-microsyntaxes.html#dates-and-times
答案 1 :(得分:0)
试试这个
DateTime add_Months = Convert.ToDateTime(textbox1.Text).AddMonths(10);
textbox2.Text = add_Months.ToString();