Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
K

KingHau

@KingHau
About
Posts
3
Topics
0
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • ContentPlaceHolder [modified]
    K KingHau

    Ok, I see. So I think first we should implement a method that list all ContentPlaceHolder control such as GetAllContentPlaceHolders. Then we will loop all get controls and search all inside controls. The GetAllContentPlaceHolders could be implemented as following code:

        private IEnumerable<Control> GetAllContentPlaceHolders()
        {
            Queue<Control> controls = new Queue<Control>();
            foreach (Control c in Page.Controls)
            {
                controls.Enqueue(c);
            }
            while (controls.Count > 0)
            {
                Control c = controls.Dequeue();
                if (c is ContentPlaceHolder)
                {
                    yield return c;
                }
                foreach (Control ic in c.Controls)
                {
                    controls.Enqueue(ic);
                }
            }
        }
    

    After that in your orginal ListControlCollections method, you should replace AddControls(Page.Controls, controlList); by

            foreach (Control c in GetAllContentPlaceHolders())
            {
                AddControls(c.Controls, controlList); 
            }
    

    Hope it helps Best regards, HauLD

    Make it better.

    ASP.NET csharp asp-net design data-structures help

  • ContentPlaceHolder [modified]
    K KingHau

    The simple way is that you should replace your code [AddControls(Page.Controls, controlList);] in method ListControlCollections by the code [AddControls(Page.Master.FindControl("ContentPlaceHolder1").Controls, controlList);] In above code I assume that your ContentPlaceHolder ID is "ContentPlaceHolder1". The idea of this code is that you first search your ContentPlaceHolder then only search all controls in the searched ContentPlaceHolder control.

    Make it better.

    ASP.NET csharp asp-net design data-structures help

  • ajax for partial refresh of the page
    K KingHau

    The easiest way is move your timer control into

    Make it better.

    ASP.NET csharp help html linq design
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups