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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T01:51:01+00:00 2026-05-22T01:51:01+00:00

Hello I have an issue with debugging code of my UserControls. I am adding

  • 0

Hello I have an issue with debugging code of my UserControls. I am adding my UserControls dynamic to a placeHolder on a layout. After the controls have been added to the placeholder, when I have attached VS2008 to my worker process I only get to debug my code once. Normally when i refresh my page in IE / Firefox my breakpoint are hit again, but now they are not.
This is some of the code used to add controls to my page:

ascx for the UserControl in which the cs adds the other UserControls dynamicly:

<asp:Repeater ID="rptListRenderer" runat="server" EnableViewState="false">
    <ItemTemplate>
        <asp:PlaceHolder ID="Content" runat="server" />
    </ItemTemplate>
</asp:Repeater>

part of .cs of this file where I add the controls:

 if (e.Item.ItemType == ListItemType.AlternatingItem || e.Item.ItemType == ListItemType.Item)
            {
                Item dataItem = (Item)e.Item.DataItem;

                System.Web.UI.WebControls.PlaceHolder content = (System.Web.UI.WebControls.PlaceHolder)e.Item.FindControl("content");
                if (content != null)
                {
                    RenderingReference[] renderings = dataItem.Visualization.GetRenderings(Sitecore.Context.Device, false);
                    foreach (RenderingReference rendering in renderings)
                    {
                        string strDataSource = dataItem.ID.ToString();
                        rendering.Settings.DataSource = strDataSource;
                        content.Controls.Add(rendering.RenderingItem.GetControl(rendering.Settings));
                    }
                }
            }

What I have also noticed is that when I work with cookies or with dynamicly added controls inside the UserControls that are added dynamicly, I have to rebuild to see effect.
For example:

I add a cookie with a GUID of an item which is used to determine a class on a HyperLink on a dynamicly added control. The class is only changing after a build, while I want it to change after a page refresh without building my project.
Is there anyone around that had similar problems or might have a clue what can be happening here? If I need to be more specific on one of the above described things please tell me!

  • 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-05-22T01:51:02+00:00Added an answer on May 22, 2026 at 1:51 am

    I have had this issue several times now. We are developing on the CMS Sitecore and Sitecore has caching options. When Caching – Vary by data is true on a Rendering that places Controls code behind, those Controls won’t be reloaded but re-used. This is why the breakpoints won’t be hitted.

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

Sidebar

Related Questions

Possible Duplicate: NSNumber retain count issue Hello, I have the following code: NSNumber *number
Hello friends I have an issue adding a special class to a couple of
Hello I have this code I am trying to fix, the issue is that
hello i have a silly issue, my link isn't shown. i use the same
hello fellow java developers. I'm having a bit of an issue here. I have
Hello I have the following code namespace ConsoleApplication2 { class Program { static void
Hello I have been having trouble with this for a while now. I have
Hello I have an issue deploying my silverlight project to an existing website (normal
Hello, I have a very annoying issue with my parse function. I'm receiving a
I have Eclipse Helios SR1 installed on Windows XP. I am writing/debugging Java code

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.