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

  • SEARCH
  • Home
  • 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 7731179
In Process

The Archive Base Latest Questions

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

I try to access the MainContentBlock control from the aspx, but unable to do

  • 0

I try to access the MainContentBlock control from the aspx, but unable to do so.

In the aspx file I have registered both controls:

<uc3:ContentBlock ID="MainContentBlock" runat="server" DynamicParameter="id" DefaultContentID="3951" /></uc3>

<uc3:childshow ID="Childshow" runat="server"/></uc3>

In the code behind for child.ascx

If Me.Parent.Page.FindControl("MainContentBlock") IsNot Nothing AndAlso Me.MainContentBlock.Item.Id = 4357 Then

…

But the error says BC30456: ‘MainContentBlock’ is not a member of ‘child’.

It’s almost like the “.parent” part did not work.

However, If I try the following:

If Me.Parent.MainContentBlock IsNot Nothing AndAlso Me.MainContentBlock.Item.Id = 4357 Then

…

It will bring up the error “BC30456: ‘MainContentBlock’ is not a member of ‘System.Web.UI.Control’.

and seems it at least recognized the .parent part again.

confused… please help, thanks.

  • 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-01T06:24:58+00:00Added an answer on June 1, 2026 at 6:24 am

    It’s because you’re trying to reference MainContentBlock as a property of the child control. When you use Me.MainContentBlock, Me refers to the child control.

    You just need to use FindControl, and properly reference the found control:

    Dim myBlock As ContentBlock = TryCast(Me.Parent.FindControl("MainContentBlock"), ContentBlock)
    
    If myBlock IsNot Nothing Then
        'do things with myBlock
    End If
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have try to access the map in jsf using C:foreach.But i can't access
I have a problem when I try to access to a webservice from a
I try to access sms db file in xcode but fail. I know its
I have a scenario that when I try to access a hash key using
I have made a program that continuously monitors a log file. But I don't
I try to access some values in a NSMutableArray I created, but I only
If I try to access this system variable from the Run... dialog, Windows tells
try to access an ldap server from an iis server in a dmz and
I try to access information from Twitter and I followed this link: http://code.google.com/p/sociallib/wiki/SocialLibGuide I
I try to access from a browser a simple mailing list service I developed.

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.