GRIDVIEW正確處理多行文字方框換行之查詢結果
//with template
((Label)e.Row.FindControl("LabelAfterCourseStatus")).Text = ((Label)e.Row.FindControl("LabelAfterCourseStatus")).Text.Replace("\r\n", "<br/>");
//without template
e.Row.Cells[1].Text=e.Row.Cells[1].Text.Replace("\\n", "<br/>");
PS. 請將<>改成小寫
((Label)e.Row.FindControl("LabelAfterCourseStatus")).Text = ((Label)e.Row.FindControl("LabelAfterCourseStatus")).Text.Replace("\r\n", "<br/>");
//without template
e.Row.Cells[1].Text=e.Row.Cells[1].Text.Replace("\\n", "<br/>");
PS. 請將<>改成小寫
留言