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 9317107
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 19, 20262026-06-19T02:47:40+00:00 2026-06-19T02:47:40+00:00

The following code will not add a control to an aspx placeholder: var control

  • 0

The following code will not add a control to an aspx placeholder:

var control = new ASCXControl { ID="searchFilters", Filters = filters };

var placeholder = Utility.FindControlRecursive(Page, "rightColumnSearchFilters") as PlaceHolder;
if(placeholder != null){
  placeholder.Controls.Add(control);
  placeholder.Visible = true;
}

When debugging, the placeholder is found and the control shows as added to the placeholder controls collection after entering the block, but yet I see nothing render into the placeholder on the page.

I currently need to pass variables to the control in order to find the filters I need to display. Although I don’t like passing variables between controls, I don’t see any other way.

What am I missing would make the control not render? Is there a better way to do this?

EDIT:

I am trying to get the HTML inside of the ascx to render. I am able to get the Filters parameters inside the Page_Load on the control.

  • 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-19T02:47:42+00:00Added an answer on June 19, 2026 at 2:47 am

    This may or may not be the whole problem, but usually trying to instantiate a UserControl the way you’re doing it leads to problems. You should do it using the LoadControl(path) method of the Page class:

    ASCXControl ctl = (ASCXControl) LoadControl("path");
    

    I’m not 100% sure, but I think that if you just instantiate it like an ordinary class/control, you wind up not running all the event handlers (such as Load) that you usually would.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

The following code will add the categories selector widget to the WordPress Page editor
The following code will search for the user within the domain controller, but I
The following code will log in my application to a server. That server will
Does the following code will increase the allocated memory continuously as it is called
Why the following code will return obvious , surprise! (and lastly how come? ).
level: beginner the following code will print 'False' def function(x): if len(x) == 5:
I have following code in my Application. Comments in my code will specify My
Hi can someone explain if the in the following code the synchronized code will
I have the following code which will generate two pdf files containing plots to
I have the following code which will allow only numbers 0-9. But i want

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.