Type.GetType(string)
requires an assembly-qualified type name.
Anton Gogolev
2009-04-15 13:21:19
Type.GetType(string)
requires an assembly-qualified type name.
The reason this is occurring is because you are compiling each page individually becuase you are using a website instead of a web project.
So each page is an individual assembly that doesn't know about the other. If you want to use the GetType I would recommend changing to a web project to make your life easier.
In the markup for your aspx page you can specify the master page type you are using like so:
<%@ MasterType VirtualPath="~/MasterPage.master" %>
In any case, you can get the type of the current master page back from a call like this in your codebehind:
protected void Page_Load(object sender, EventArgs e)
{
Type t;
t = this.Master.GetType();
}
add to what Steve suggested, i use his method all the time, also check this MSDN article about MasterType directive.