Hello! I've created a Master Page with ASP.Net, C# and right after that I created a "Web Form With Master Page" which I named Index.aspx so I could see the page in a browser. Now when I choose IIS Express (Google Chrome) or View in Browser, a Server Error is happening with error message "CS0426: The type name 'Site1' does not exist in the type 'MasterPage' ". Has it ever happened to you and do you know how I could fix it?
Use
typeof(Site1)
instead of
typeof(MasterPage.Site1)
With MasterPage you are referring to System.Web.UI.MasterPage but that is not the namespace of Site1
Edit: Based on your screenshot, I found the underlying problem. Your project is called MasterPage and the namespace as well. This results in a clash between System.Web.UI.MasterPage and your other classes. Please recreate the project with another project name and your problem will resolve itself.