Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. Web Development
  3. ASP.NET
  4. Way to access masterpage from usercontrol

Way to access masterpage from usercontrol

Scheduled Pinned Locked Moved ASP.NET
3 Posts 2 Posters 2 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • W Offline
    W Offline
    Wouter Coinless
    wrote on last edited by
    #1

    Hi! Is there a way to access a control in my MasterPage from my custom user control. I have MasterPage with custom control --> Default.aspx --> User Control And my last User Control needs to access the custom control in my master. Or do i have to work with delegate in my default.aspx Thanks! Wouter

    A 1 Reply Last reply
    0
    • W Wouter Coinless

      Hi! Is there a way to access a control in my MasterPage from my custom user control. I have MasterPage with custom control --> Default.aspx --> User Control And my last User Control needs to access the custom control in my master. Or do i have to work with delegate in my default.aspx Thanks! Wouter

      A Offline
      A Offline
      Abhishek Sur
      wrote on last edited by
      #2

      How about this.Page.FindControl("id"); Try it, I think it will find the control. :-D

      Abhishek Sur


      My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

      **Don't forget to click "Good Answer" if you like to.

      W 1 Reply Last reply
      0
      • A Abhishek Sur

        How about this.Page.FindControl("id"); Try it, I think it will find the control. :-D

        Abhishek Sur


        My Latest Articles **Create CLR objects in SQL Server 2005 C# Uncommon Keywords Read/Write Excel using OleDB

        **Don't forget to click "Good Answer" if you like to.

        W Offline
        W Offline
        Wouter Coinless
        wrote on last edited by
        #3

        public partial class Administration_Controls_FileControl : System.Web.UI.UserControl
        {
        protected void Page_Load(object sender, EventArgs e)
        {
        Control control = this.Page.FindControl("MessageControl");

        Gives back null

        Control control = this.Page.FindControl("ctl00");

        That gives my masterpage :) Not really nice id

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups