문제

코드를 통해 Contentplaceholder에서 데이터를 설정할 수 있습니까? 이것이 제가 생각하는 것입니다.

dim oCPH as new ContentPlaceHolder
oCPH.id = "column1" 'this id is the one that corresponds with the ID I set on the page
oCPH.content = "content here" '<-- not real code

분명히 그것은 올바른 구문이 아니며, 이것이 내가 요구하는 것을 명확히하기를 바랍니다.

도움이 되었습니까?

해결책

현재 페이지의 MasterPage 요소를 통해 참조 할 수 있어야합니다. 같은 것 :

ContentPlaceHolder cph = (ContentPlaceHolder)Master.FindControl("column1");

MasterPage CodeBehind에 있으면 이름으로 참조하십시오.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top