Friday, October 3, 2014

Access Master Page Controls from ASP.NET Page

11:10 AM - By azeheruddin khan 0

Access Master Page Controls from ASP.NET Page

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="MyMaster.master.cs" Inherits="Access_Master_Page_Controls_from_ASP.NET_Page.MyMaster" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "">

<html xmlns="">
<head runat="server">
    <title>Access Master Page Controls from ASP.NET Page</title>
    <asp:ContentPlaceHolder ID="head" runat="server">
    <form id="form1" runat="server">
        <asp:Label ID = "lblMaster" runat = "server"></asp:Label>        
        <asp:ContentPlaceHolder ID="ContentPlaceHolder1" runat="server">

protected void btnChild_Click(object sender, EventArgs e)
   Label lLabel = this.Master.FindControl("lblMaster") as Label;
   lLabel.Text = "<b>This Label is in master page </b>";

About the Author

I am Azeheruddin Khan having more than 6 year experience in c#, and ms sql.My work comprise of medium and enterprise level projects using and other Microsoft .net technologies. Please feel free to contact me for any queries via posting comments on my blog,i will try to reply as early as possible. Follow me @fresher2programmer
View all posts by admin →

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post



© 2014 Fresher2Programmer. WP Theme-junkie converted by Bloggertheme9
Powered by Blogger.
back to top