0

I have a simple master page defined as such:

Public Class AppUIMasterPage
Inherits System.Web.UI.MasterPage

Then i have a base class for content pages:

Public MustInherit Class AppUIBase
Inherits System.Web.UI.Page

Then the master page tag:

<%@ Master Language="VB" AutoEventWireup="false" CodeBehind="my.master.vb" Inherits="AppUI.AppUIMasterPage" %>

On the content page:

 Page Title="" Language="vb" AutoEventWireup="false" MasterPageFile="~/my.Master" CodeBehind="somecontentpage.aspx.vb" Inherits="AppUI.viewprocedure" %>

And content code-behind

Public Class viewprocedure
Inherits AppUIBase

The designer automatically inserts the following:

 '''<summary>
'''Master property.
'''</summary>
'''<remarks>
'''Auto-generated property.
'''</remarks>
Public Shadows ReadOnly Property Master() As AppUI.AppUIMasterPage
    Get
        Return CType(MyBase.Master, AppUI.AppUIMasterPage)
    End Get
End Property

When i try to build the complier throws an error and intellisense wants me to change AppUI.AppUIMasterPage to: Global.AppUI.AppUIMasterPage

I'm not exactly sure why it is doing this, and I would be OK if it was just a simple change, however every time i close and re-open the page VS changes it and before i build i have to change it back again.

dan h
  • 73
  • 1
  • 10

2 Answers2

1

I believe if you use the System.ComponentModel.DesignerCategory attribute with a blank string as the parameter, the designer will stop trying to automatically mess up your file.

Ref: Disable designer in Visual Studio?

Community
  • 1
  • 1
Jason
  • 174
  • 3
  • 18
0

While disabling the designer would be one approach, the better way was just to rename the classes in such a way that the designer was no longer getting confused. Find and replace was my best friend in doing this.

This issue only appears to occur if the base class names confuse the designer.

dan h
  • 73
  • 1
  • 10