Reputation: 12998
I'm trying to display a string on my content page which is set in the master page but i'm getting the error message: 'compid' is not a member of 'ASP.test_master'
Here's my master page code:
<%@ Master Language="VB" debug="true" %>
<script runat="server">
Dim compid As String = "test"
</script>
<html>
<head></head>
<body>
<asp:ContentPlaceHolder id="CPHLoginButton" runat="server" />
</body>
</html>
And my content page code:
<%@ Page Language="VB" MasterPageFile="test.master" %>
<%@ MasterType virtualpath="~/test.master" %>
<asp:Content ContentPlaceHolderId="CPHLoginButton" runat="server">
<%= Master.compid %>
</asp:Content>
Any ideas?
Upvotes: 0
Views: 123
Reputation: 6802
Its probably becuase of default access modifier. Your problem can be solved by making compid public somethign like this Public compid As String = "test"
Upvotes: 1