This is my master page
The code behind my default.aspx page is
The reference "MasterPages_mymasterpage" keeps appearing and disappearing out of the autocomplete context dropdown and has now stopped appearing all together.
I've tried adding
MasterPageFile = "~/MasterPages/mymasterpage.master";
to the c# and
<%@ MasterType VirtualPath="~/MasterPages/mymasterpage.master"%>
to the aspx file, but neither has any effect
Anybody have any ideas why MasterPages_mymasterpage keeps dropping out or knows of some better way to reference a variable in a master page from a sub page?
Also, I need it in a user control eventually, should the code that fixes default.aspx be used for mycontrol.ascx??
Thanks
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class MasterPages_mymasterpage : System.Web.UI.MasterPage
{
protected void Page_Load(object sender, EventArgs e)
{
}
public string xyz
{
get { return "xyz"; }
}
}
The code behind my default.aspx page is
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string a = "";
a = ((MasterPages_mymasterpage)this.Master).xyz;
The reference "MasterPages_mymasterpage" keeps appearing and disappearing out of the autocomplete context dropdown and has now stopped appearing all together.
I've tried adding
MasterPageFile = "~/MasterPages/mymasterpage.master";
to the c# and
<%@ MasterType VirtualPath="~/MasterPages/mymasterpage.master"%>
to the aspx file, but neither has any effect
Anybody have any ideas why MasterPages_mymasterpage keeps dropping out or knows of some better way to reference a variable in a master page from a sub page?
Also, I need it in a user control eventually, should the code that fixes default.aspx be used for mycontrol.ascx??
Thanks