如何获取FormView模版中控件的值
我是ASP.net的初学者,我想知道如何获取DetailsView或者是FormView中模版中某一个控件的值.
------解决方案--------------------((TextBox)FormViewID.FindControl("TextBoxID")).Text = ((Calendar)FormViewID.FindControl("CalendarID")).SelectedDate.ToString();
太长了:
TextBox TextBoxID = FormViewID.FindControl("TextBoxID") as TextBox;
Calendar CalendarID = FormViewID.FindControl("CalendarID") as Calendar;
TextBoxID.Text = CalendarID.SelectedDate.ToString();