Click here to Skip to main content
15,892,005 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: PayPal problem Pin
Adam R Harris16-Jun-10 4:58
Adam R Harris16-Jun-10 4:58 
QuestionRe: PayPal problem [modified] Pin
chayanban29-Dec-10 1:42
chayanban29-Dec-10 1:42 
QuestionContentPlaceHolder [modified] Pin
eslam soliman15-Jun-10 23:50
eslam soliman15-Jun-10 23:50 
AnswerRe: ContentPlaceHolder Pin
Sandeep Mewara16-Jun-10 0:21
mveSandeep Mewara16-Jun-10 0:21 
GeneralRe: ContentPlaceHolder Pin
eslam soliman16-Jun-10 1:06
eslam soliman16-Jun-10 1:06 
AnswerRe: ContentPlaceHolder Pin
KingHau16-Jun-10 21:15
KingHau16-Jun-10 21:15 
GeneralRe: ContentPlaceHolder Pin
eslam soliman16-Jun-10 22:57
eslam soliman16-Jun-10 22:57 
GeneralRe: ContentPlaceHolder Pin
KingHau17-Jun-10 0:38
KingHau17-Jun-10 0:38 
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.

GeneralRe: ContentPlaceHolder Pin
eslam soliman22-Jun-10 1:41
eslam soliman22-Jun-10 1:41 
QuestionProcess large file in asp.net Pin
Rohit16db15-Jun-10 22:08
Rohit16db15-Jun-10 22:08 
AnswerRe: Process large file in asp.net Pin
Rhys Jacob15-Jun-10 22:13
Rhys Jacob15-Jun-10 22:13 
GeneralRe: Process large file in asp.net Pin
Rohit16db15-Jun-10 22:37
Rohit16db15-Jun-10 22:37 
AnswerRe: Process large file in asp.net Pin
meeram39516-Jun-10 1:23
meeram39516-Jun-10 1:23 
GeneralRe: Process large file in asp.net Pin
Rohit16db16-Jun-10 3:29
Rohit16db16-Jun-10 3:29 
AnswerRe: Process large file in asp.net Pin
shreekar17-Jun-10 4:03
shreekar17-Jun-10 4:03 
QuestionDataGrid Checkbox Column Unchecked!! Pin
NinaWilliam15-Jun-10 21:35
NinaWilliam15-Jun-10 21:35 
AnswerRe: DataGrid Checkbox Column Unchecked!! Pin
meeram39515-Jun-10 21:49
meeram39515-Jun-10 21:49 
GeneralRe: DataGrid Checkbox Column Unchecked!! Pin
NinaWilliam16-Jun-10 0:40
NinaWilliam16-Jun-10 0:40 
AnswerRe: DataGrid Checkbox Column Unchecked!! Pin
Brij15-Jun-10 21:49
mentorBrij15-Jun-10 21:49 
Questionknow how to directly get the rowindex of a gridview in the child control's event Pin
sumans432415-Jun-10 20:46
sumans432415-Jun-10 20:46 
AnswerRe: know how to directly get the rowindex of a gridview in the child control's event Pin
meeram39516-Jun-10 1:39
meeram39516-Jun-10 1:39 
QuestionArt of XSD - A Must read book Pin
HimaBindu Vejella15-Jun-10 20:41
HimaBindu Vejella15-Jun-10 20:41 
AnswerRe: Art of XSD - A Must read book Pin
R. Giskard Reventlov15-Jun-10 21:53
R. Giskard Reventlov15-Jun-10 21:53 
QuestionSessions Pin
kheer15-Jun-10 20:38
kheer15-Jun-10 20:38 
AnswerRe: Sessions Pin
Brij15-Jun-10 20:53
mentorBrij15-Jun-10 20:53 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.