The below codes populate textboxes (IDs = StartDatePr and EndDatePr) on page load with default values:
protected void Page_Load(object sender, EventArgs e)
{if (!IsPostBack)
{
StartDatePr.Text = DateTime.Now.AddDays(-30).ToString("MM/dd/yyyy");
EndDatePr.Text = DateTime.Now.ToString("MM/dd/yyyy");
}
}
protected void Page_Load(object sender, EventArgs e)
{if (!IsPostBack)
{
StartDatePr.Text = DateTime.Now.AddDays(-30).ToString("MM/dd/yyyy");
EndDatePr.Text = DateTime.Now.ToString("MM/dd/yyyy");
}
}
No comments:
Post a Comment