i have lots of control(like textbox, labels, listbox, dropdownlist etc.) and everytime i access the control i have use this set of 3 lines code:
ContentPlaceHolder content;
content = (ContentPlaceHolder)Page.Master.FindControl("ContentPlaceHolder1");
RadPanelbar myRadPanelbar = (RadPanelbar)content.FindControl("RadPanelbar");
is there a way i can put that somewhere and access from any where in the project ?
for an example, if i have to access my dropdownlist, just a dropdownlist i have to do this:
ContentPlaceHolder content;
content = (ContentPlaceHolder)Page.Master.FindControl("ContentPlaceHolder1");
RadPanelbar myRadPanelbar = (RadPanelbar)content.FindControl("RadPanelbar");
DropDownList ddlus = (DropDownList)myRadPanelbar.FindControl("ddlus"); ///<<<<
what is the best way to deal this?
thanks in advance