MasterPage Property Woes

written by Ryan Olshan on Sunday, December 25 2005

For some reason I'm not able to access public properties that I declare in a MasterPage, even though it is supposed to work. So, I discovered a way around it was to use FindControl. The example below demonstrates accessing a Literal control with an ID of litText in a MasterPage file.

VB.NET
Dim lit As Literal
lit = Me.Master.FindControl("litText")

C#
Literal lit;
lit = (Literal)this.Master.FindControl("litText");

Kick this post on .NET Kicks

Similar Posts

  1. LinqDataSource, ListView, and DataPager example
  2. NUnitForms GenericControlTester
  3. Useful SQL Script

Post a comment