c# - [TemplateContainer(typeof(MasterPage.Site1))] -
i have error. how can solve it?
cs0426: type name 'site1' not exist in type 'masterpage'
here masterpage code:
you need set inherits attribute on markup of master page qualified class name . saying open "site1.master.cs" , see class name inherits masterpage .if class part of namespace should set youtr inherits attribute [namespace].[classname]
for example in sample project. master page has following directive on top
<%@ master language="c#" autoeventwireup="true" codefile="site.master.cs" inherits="sitemaster" %>
and codebehind class (site.master.cs) : see sitemaster class master page inherits from. asp.net form engine compiles markup class derives base class behind scenes
public partial class sitemaster : masterpage { private const string antixsrftokenkey = "__antixsrftoken"; private const string antixsrfusernamekey = "__antixsrfusername"; private string _antixsrftokenvalue; protected void page_init(object sender, eventargs e) }
Comments
Post a Comment