Tuesday, June 08, 2010

How to access controls with in different Content Place Holders

Sometimes it may necessary to access controls with in differnt Content Place Holders in the page. Solution is prefix Content Place Holder id with '$' control name.
Control control = this.FindControl("FooterPlaceHolder$txtSearch");


<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent">
                ConnectionString="<%$ ConnectionStrings:ActiveConnectionString%>"
                SelectCommand="SELECT * FROM dbo.Country"
<asp:Content ID="FooterContent" runat="server" ContentPlaceHolderID="FooterContent">
    <asp:TextBox runat="server" ID="txtSearch" />

No comments:

iPhone Launch Screen Sizes

iPhone Portrait iOS 8 Retina HT 5.5 = 1242 X 2208 Retna HD 4.7 = 750 X 1134 iPhone Landscape iOS 8 Retina HD 5.5  2208 X 1242 iPho...