我想将日期加载到满月的文本框中,这意味着用户每次要将日期保存为当前日期和时间文本框。他们不会写任何东西如何获取完整的日期和全月名称,如2015年11月02日
这里是我想要的格式“2015年11月2日”但我没有得到想找的东西。我得到了这个结果“DD-NOV-2015”,这不是我要找的。
你应该知道什么简单的办法可以使用j个查询,AJAX或任何这样做,请帮助
请参考下面
页面加载
protected void Page_Load(object sender, EventArgs e)
{
this.txtInceptiondate.Text = DateTime.Now.ToString("DD-MMM-yyyy",System.Globalization.CultureInfo.InvariantCulture).ToUpper();
}
我的代码保存到数据库
protected void tbnSave_Click(object sender, EventArgs e)
{
IList<tblPolicy> _Inception = _dc.tblPolicies.Where(a => a.Name == txtname.Text.ToString()).ToList();
if (_Inception != null)
{
if (_Inception.Count() == 0)
{
tblPolicy _Policy = new tblPolicy
{
Name = txtname.Text,
PolicyName = txtpolicyname.Text,
InceptionDate = txtInceptiondate.Text
};
_dc.tblPolicies.InsertOnSubmit(_Policy);
_dc.SubmitChanges();
lblresults.Visible = true;
lblresults.Text = "Welcome " + txtname.Text + " ! , Your new policy " + txtpolicyname.Text + " is well recived!";
txtpolicyname.Text = "";
txtname.Text = "";
txtInceptiondate.Text = "";
}
}
}
感谢您的帮助! – JuniorLinq