获取使用模板页的页面中的控件,首先需要获取母版页的相应占位符(ContentPlaceHolder),然后再从该占位符中获取相应空间。 如今天做一个跨页传递参数的搜索时,就用到了: if (Page.PreviousPage != null) { ContentPlaceHolder mycontentholder = (ContentPlaceHolder)PreviousPage.Master.FindControl("ContentPlaceHolder1");//获取传递参数页面母版页占位符 UserControl myuc = (UserControl)mycontentholder.FindControl("searchUC1");//寻找控件 if (myuc != null) { string tempKeyWords = ((TextBox)myuc.FindControl("txtKeyWord")).Text.ToString(); tempKeyWords = tempKeyWords.Replace(" ", ","); tempKeyWords = tempKeyWords.Replace("|", ","); tempKeyWords = tempKeyWords.Replace(",", ","); keyWords = tempKeyWords.Split(new string[] { "," }, StringSplitOptions.RemoveEmptyEntries); articleListBind(getSearchArticleList(keyWords)); }