I am trying to reference a variable in my MasterPage, but I am getting errors.
I tried
<%@ MasterType" %>
which gives the following error:
Compiler Error Message: CS0030: Unable to Convert Type 'IPAMIntranet.IPAMIntranetMaster' to 'ASP.ipamintranetmaster_master'
and
string tVar = ((MyNamespace.MyMasterPage)Master).variable
Cannot start object of type 'ASP.ipamintranetmaster_master' for type 'IPAMIntranet.IPAMIntranetMaster'.
Does anyone know what is going on, or am I missing something.
I dealt with this using the interface.
You need to specify the virtual path to the main page on the content page.
<%@ MasterType VirtualPath="Master.Master" %>
, IPAMIntranet.IPAMIntranetMaster, IPAMIntranet.IPAMIntranetMaster, - , .
IPAMIntranet.IPAMIntranetMaster
MasterType , , intellisense. VirtualPath , TypeName, , , , .
MasterType
VirtualPath
TypeName
Source: https://habr.com/ru/post/1755490/More articles:How to elegantly access Android Views from another theme? - androidHow to parse css (stylesheet) comments (annotations)? - javaПросто установлен django-tinymce, но HTMLField не отображается в представлении администратора - djangoIs it possible to create a jQuery event that fires when the scrollbar is released? - jqueryASP.Net - How to access the main page Object from a regular page? - asp.netCreating rows with an index between two numbers - tsqlIn Linq to SQL, why does assigning a linked object create a ChangeSet insert? - linqget # from url in php - phpМожет ли LINQ упорядочить по индексу столбца? - linqHow to handle the encoding request correctly? - httpAll Articles