首页 > 解决方案 > 如何通过在母版页上设置公共属性将标签的值从母版页获取到另一个页面

问题描述

我在母版页上有一个标签,需要将标签的值解析到另一个页面上。我已经为母版页上的标签设置了公共属性,并且还在另一页上定义了母版页的虚拟路径,但我收到错误“BC30002 type myprojectname.site1.master is not difined”。请问有什么帮助吗?下面是我的代码

//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>

标签: asp.netvb.net

解决方案


推荐阅读