フォーム ビュー内にあるラベルをフォーマットする簡単な方法があるかどうかを知りたいです。使用するコードは次のとおりです。イベント フォーム ビュー データバインド内にあります。
protected void FormView2_DataBound(object sender, EventArgs e)
{
if (FormView2.CurrentMode == FormViewMode.Edit)
{
Label DAT_Label1 = (Label)FormView2.FindControl("DAT_Label1");
if (DAT_Label1 != null)
{
DateTime date = Convert.ToDateTime(DAT_Label1.Text);
DAT_Label1.Text = string.Format("{0:dd/MM/yyyy}", date);
}
}
}
このフォーマットを作成するのに役立つラベル コントロールの属性はありませんか?