<%@ Page Title="" Language="C#" MasterPageFile="~/MasterPage.master" AutoEventWireup="true" CodeFile="Dang.aspx.cs" Inherits="Dang" %> <asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server"> <asp:Content ID="Content2" runat="server" contentplaceholderid="Content1"> <asp:TextBox ID="txt" runat="server">
TextBox t =(TextBox) Master.FindControl("Content1").FindControl("txt"); TextBox txtuser = (TextBox)Page.Master.FindControl("txtUser"); t.Text = txtuser.Text;
public partial class MasterPage : System.Web.UI.MasterPage { protected void Page_Load(object sender, EventArgs e) { txtUser.Text = "John"; } }
//Content1 is your ContentPlaceHolder id in master page TextBox t =(TextBox)Content1.FindControl("txt");
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)