Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7786683
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T20:27:24+00:00 2026-06-01T20:27:24+00:00

I have problem. I have site.master which includes a couple of user controls. Now

  • 0

I have problem. I have site.master which includes a couple of user controls. Now I need to pass value (string) from actual pages code behind to master pages user control (Property) .

So my master is like this:

<%@ Master Language="VB" CodeFile="/scripts/pohjakoodit.master.vb" Inherits="pohjakoodit"  AutoEventWireup="false"  debug="false" %>

… on the end of master there is:

<ucSheriff:sheriffala ID="sheriffala" statvalue="atesti" runat="server" />

Then I have actual page which starts like this:

<%@ Page Language="vb" MasterPageFile="site.master" AutoEventWireup="false" CodeFile="/scripts/alkuuutisetxw.aspx.vb" Inherits="uutiset_index" debug="true"  %>

The sheriffala.ascx has property

dim Public staref As String = ""    

    Public Property statvalue() As String
        Get
            Return statvalue
        End Get
        Set(ByVal value As String)
            staref = value
        End Set
    End Property

Now I try to access property statvalue from user control sheriffala in code behind file alkuuutisetxw.aspx.vb.

I have tried the very basics like
sheriffala.statvalue = "my srting"
or
page.master.sheriffala.statvalue = "my srting"
And tried couple of binding, non of them have’t worked out.

So how do I pass a string to user controls property from code behind file?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T20:27:25+00:00Added an answer on June 1, 2026 at 8:27 pm

    You need to make sure your UserControl is Public on your MasterPage. Then in the CodeBehind of your ContentPage, you need to create an instance of your MasterPage and you should be good to go to access statvalue(), since it’s already Public.

    Or if you don’t like messing with the designer file, you can make properties that expose your UserControls and MasterPage:

    MasterPage:

    Public ReadOnly Property UCSheriffala() As Sheriffala
        Get
            Return Me.Sheriffala
        End Get
    End Property
    

    Content Page:

    Public Shadows ReadOnly Property Master() As Pohjakoodit
        Get
            Return CType(MyBase.Master, Pohjakoodit)
        End Get
    End Property
    

    Usage Example:

    Response.Write(Master.UCSheriffala.statvalue)
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have created a control on my Site.Master page which pulls data from an
I have LogOn.ascx control which is located on master page site.master: <% Html.RenderPartial(LogOn); %>
I have a problem with my site. I want that the shadow stops at
I have a problem on my site's login page in IE7 browser. One of
I have a problem in a site that I am trying to develop Sometimes
I have a problem with my site. The site has multiple entities: Articles, Posts,
i have this annoying problem with my site where, when you click on a
I have a problem with my search on my site I don't understand why
I have a problem with a oneway web method that open a moss site
I have a problem with Drupal uploads path when in a multi language site.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.