0

I have a label on master page and need to parse the value of the label onto another page. I have set a public property for the label on the master page and I have also defined the virtual-path of the master page on the other page but i get the error "BC30002 type myprojectname.site1.master is not difined". Please any help? below is my code

//this is the codebehind of my mastser page
Public Property userid As Label

    Get
        userid = Me.lbluserid()
        Return userid
    End Get
    Set(value As Label)
        userid.Text.ToString()
    End Set
End Property


//this is my content page
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="proudctselection.aspx.vb" 
MasterPageFile="~/Site1master.Master" Inherits="RANAMART.proudctselection" %>
<%@ MasterType  VirtualPath="~/Site1master.Master" %>
 <asp:Content ID="rannamart" ContentPlaceHolderID="rannamart" runat="server">  
//somthing goes here
</asp:Content>
mcvision
  • 21
  • 6
  • This might help you, https://stackoverflow.com/questions/15573505/how-to-access-master-page-control-from-content-page – Avdhoota Apr 27 '20 at 23:03
  • Please I have done same but I still get the error on my second page "BC30002 type myprojectname.site1.master is not difined" – mcvision Apr 27 '20 at 23:29
  • i was once using visual studio 2013 and this same method works but am now using visual studio 2019 community and is giving me that error please kindly assist – mcvision Apr 27 '20 at 23:44
  • This is a very detailed article, check it out, https://www.codeproject.com/Tips/801325/Access-Master-Page-Controls-from-Content-Page-in-C – Avdhoota Apr 27 '20 at 23:56
  • I have finally resolved it I realized my bin folder is empty I don't know what caused it though. so I had to copy the those files from my projects backup I made into my bin folder and that fixed my problem thank you very much – mcvision Apr 28 '20 at 11:52

0 Answers0