U
User
OK, I asked in a reply, but I've wasted far too long so I'm going to put
a new post out there in hopes that it will be more visible.
I have a MasterPage. I want to call a method declared in that class from
a Page that uses the MasterPage. How do I do that?
public partial class List : System.Web.UI.MasterPage
{
protected ArrayList m_SortList;
public int AddSortChoice( string inString )
{
return m_SortList.Add( inString );
}
}
public partial class PostingList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// this.Master.AddSortChoice("test"); /* <-- doesn't work */
}
}
I've tried:
- this.Master.AddSortChoice("up");
- UserControl ctl = (Master)this.Master;
- A bunch of other zany attempts
- Googling for call method in masterpage from contentpage
Any help would be greatly appreciated. Thanks.
a new post out there in hopes that it will be more visible.
I have a MasterPage. I want to call a method declared in that class from
a Page that uses the MasterPage. How do I do that?
public partial class List : System.Web.UI.MasterPage
{
protected ArrayList m_SortList;
public int AddSortChoice( string inString )
{
return m_SortList.Add( inString );
}
}
public partial class PostingList : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
// this.Master.AddSortChoice("test"); /* <-- doesn't work */
}
}
I've tried:
- this.Master.AddSortChoice("up");
- UserControl ctl = (Master)this.Master;
- A bunch of other zany attempts
- Googling for call method in masterpage from contentpage
Any help would be greatly appreciated. Thanks.