버튼 클릭에서 편집 또는 삽입 모드에서 detailsview boundfield의 텍스트를 어떻게 업데이트 할 수 있습니까?C에서 세부 뷰 컨트롤의 텍스트 속성 업데이트하기
동일한 페이지에 detailsview 편집/삽입 양식과 FileUpload 컨트롤이 있습니다. 편집 또는 삽입 모드에서 PDF를 업로드하고 detailsview 컨트롤 텍스트 중 하나를 PDF 경로로 변경할 수 있기를 바랍니다. 같은
뭔가 :
protected void Button1_Click(object sender, EventArgs e)
{
if (DetailsView1.CurrentMode == DetailsViewMode.Insert)
{
DetailsView1.FindControl("attachment").text = FilePath;
}
}
감사합니다!
DetailsView의 DataBound 이벤트에서 컨트롤에 액세스 할 수 있습니다. –