Control control = this.FindControl("FooterPlaceHolder$txtSearch");
Example:
<asp:Content ID="BodyContent" runat="server" ContentPlaceHolderID="MainContent"> <asp:SqlDataSource id="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:ActiveConnectionString%>" SelectCommand="SELECT * FROM dbo.Country" FilterExpression="Name='{0}'"> <FilterParameters> <asp:ControlParameter Name="Name" ControlID="FooterContent$txtSearch" PropertyName="Text"/> </FilterParameters> </asp:SqlDataSource> </asp:Content> <asp:Content ID="FooterContent" runat="server" ContentPlaceHolderID="FooterContent"> <asp:TextBox runat="server" ID="txtSearch" /> </asp:Content>
No comments:
Post a Comment