[一般網頁Form傳遞變數],之前有講過了。
現在加上Master則不能用舊有的方式接收變數。
必須先抓到master的容器,才能找到對應的變數。
以下是範例
A網頁:


B網頁:

重點在於
ContentPlaceHolder ContentPlaceHolder1 = Page.PreviousPage.Master.FindControl("ContentPlaceHolder1") as ContentPlaceHolder;
TextBox textbox1 = ContentPlaceHolder1.FindControl("tag") as TextBox;
現在加上Master則不能用舊有的方式接收變數。
必須先抓到master的容器,才能找到對應的變數。
以下是範例
A網頁:
B網頁:
重點在於
ContentPlaceHolder ContentPlaceHolder1 = Page.PreviousPage.Master.FindControl("ContentPlaceHolder1") as ContentPlaceHolder;
TextBox textbox1 = ContentPlaceHolder1.FindControl("tag") as TextBox;
Reference: http://itgroup.blueshop.com.tw/ianchen/design543?n=convew&i=3997
沒有留言:
張貼留言