asp.net - 如何通过在母版页上设置公共属性将标签的值从母版页获取到另一个页面
问题描述
我在母版页上有一个标签,需要将标签的值解析到另一个页面上。我已经为母版页上的标签设置了公共属性,并且还在另一页上定义了母版页的虚拟路径,但我收到错误“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>
解决方案
推荐阅读
- python - 编辑序列化程序 Django Rest 中的属性值
- javascript - Javascript逻辑查找更大的数字以匹配输入
- docker - Docker 撰写 ECS AWS 应用程序负载均衡重定向
- python - 如何使用 yfinance 下载数据修复此错误
- json - Swift 节点树到复杂的 Json
- xml - 循环 XML 中的比较
- javascript - Redux 工具包警报删除 setTimeout
- javascript - pinFileToIPFS 400(错误请求)
- python - 如果给定列集中的所有值都是 0,我如何删除一行
- javascript - 异步/等待:后续等待不会在运行之前等待完成之前的等待