2008年9月3日 星期三

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. 請將<>改成小寫

沒有留言:

自訂權限驗證機制

// 使用 filter [Route("api/[controller]")] [ApiController] [Authorize] [TypeFilter(typeof(CustomAsyncAuthorizationFilter))] public c...