How to access the contain of master page in our cs file?
-
i have one master page which contain the menu and its menuitem. i have to access the menu or menuitem in my other .cs file(it has master page)? how can i access this?
-
i have one master page which contain the menu and its menuitem. i have to access the menu or menuitem in my other .cs file(it has master page)? how can i access this?
If what you asking is how to access controls in a Master Page from code-behind...
MyMasterPage myMaster = (MyMasterPage)this.Master;
string ImgStr = "images/test.gif";
//Calling a method from MyMasterPage
myMaster.setMasterHeaderImages(ImgStr);
myMaster.Page.Title = "Test Page Title";Check http://aspadvice.com/blogs/kiran/archive/2005/11/27/14016.aspx[^] here.
-
If what you asking is how to access controls in a Master Page from code-behind...
MyMasterPage myMaster = (MyMasterPage)this.Master;
string ImgStr = "images/test.gif";
//Calling a method from MyMasterPage
myMaster.setMasterHeaderImages(ImgStr);
myMaster.Page.Title = "Test Page Title";Check http://aspadvice.com/blogs/kiran/archive/2005/11/27/14016.aspx[^] here.
i have menu in master page and i have to access it in other cs(eg. default.aspx.cs) file.
-
i have menu in master page and i have to access it in other cs(eg. default.aspx.cs) file.
ContentPlaceHolder content; content = Master.FindControl("ContentPlaceHolder1") as ContentPlaceHolder; for ex TextBox txt=content.FindControl("txtName") as TextBox; Raju.M