G
gabe
Hi,
We have a number of projects that will use the default 'Root
Namespace' option in the project properties box. There will be a
common Master Page that will be used among the projects. I'd like to
be able to use the master page without including the root namespace in
the masterpage Page declaration. In the example below, 'TESTApp' is
the default Root namespace (the name of the project)
<%@ Page Language="vb"
AutoEventWireup="false"
MasterPageFile="~/Site3.Master"
CodeBehind="WebForm1.aspx.vb"
Inherits="TESTApp.WebForm1"
title="Untitled Page" %>
-----------------------------
<%@ Master Language="VB"
AutoEventWireup="false"
Codefile="~/Site3.master.vb"
Inherits="test.Site3" %>
--------------------------------
I can get it to compile by using the Codefile attribute. However, if I
try to create public property on the MasterPage, and use the
<%@ MasterType VirtualPath="~/Site3.Master" %>
or to Type it directly, I get a run time error stating that it the
following
----------------------------------------------------------------------------------------------------
Additional information: Unable to cast object of type
'ASP.site3_master' to type 'TESTApp.test.Site3'.
----------------------------------------------------------------------------------------------------
CType(Page.Master, test.Site3).ButtonText = "asdf"
Is there a way to do this without just removing the project 'Default
Namespace'? Or override if for the that page, and not include ti?
Thanks in advance,
Gabe
We have a number of projects that will use the default 'Root
Namespace' option in the project properties box. There will be a
common Master Page that will be used among the projects. I'd like to
be able to use the master page without including the root namespace in
the masterpage Page declaration. In the example below, 'TESTApp' is
the default Root namespace (the name of the project)
<%@ Page Language="vb"
AutoEventWireup="false"
MasterPageFile="~/Site3.Master"
CodeBehind="WebForm1.aspx.vb"
Inherits="TESTApp.WebForm1"
title="Untitled Page" %>
-----------------------------
<%@ Master Language="VB"
AutoEventWireup="false"
Codefile="~/Site3.master.vb"
Inherits="test.Site3" %>
--------------------------------
I can get it to compile by using the Codefile attribute. However, if I
try to create public property on the MasterPage, and use the
<%@ MasterType VirtualPath="~/Site3.Master" %>
or to Type it directly, I get a run time error stating that it the
following
----------------------------------------------------------------------------------------------------
Additional information: Unable to cast object of type
'ASP.site3_master' to type 'TESTApp.test.Site3'.
----------------------------------------------------------------------------------------------------
CType(Page.Master, test.Site3).ButtonText = "asdf"
Is there a way to do this without just removing the project 'Default
Namespace'? Or override if for the that page, and not include ti?
Thanks in advance,
Gabe