March 20th, 2009How To Access Content From MasterPage in ASP.NET
So, you want to access some content from inside a page that you created from an existing master page? The most clean way to do this is to create a public property in your master page, then access that. In my case, I have a search button on a master page that I want to use from inside to pages that derive from that page. So, Here is how I declare my master page:
1: <%@ Master Language="C#" MasterPageFile="~/MasterPages/MasterPage.Master" AutoEventWireup="true"
2: CodeBehind="ContactMasterPage.master.cs" Inherits="ThreePLogic.Web.ASPWeb.ContactPages.ContactMasterPage" %>
3:
4: <asp:Content ID="Content5" ContentPlaceHolderID="ContentCenter" runat="server">
5: <asp:TextBox ID="TextBoxSearchName" runat="server" Width="200px" CssClass="InputText"></asp:TextBox>
6: <asp:Button ID="ButtonSearchName" runat="server" CssClass="SearchBtn" />
7: </div>
8: </div>








