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

ASP.NET

 
GeneralRe: ow to find Textbox ID's binded inside Grid view Pin
Satish_S16-Jun-10 1:35
Satish_S16-Jun-10 1:35 
AnswerRe: ow to find Textbox ID's binded inside Grid view Pin
shreekar17-Jun-10 3:51
shreekar17-Jun-10 3:51 
Questiondisplay column headers vertically Pin
priyagee16-Jun-10 0:43
priyagee16-Jun-10 0:43 
QuestionHow to use _dopostabck() in ajax tab container Pin
sudheera p16-Jun-10 0:36
sudheera p16-Jun-10 0:36 
QuestionPayPal problem Pin
Yoyosch16-Jun-10 0:02
Yoyosch16-Jun-10 0:02 
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 
Hello Every One,
i have a function that loop inside the controls inside my asp.net page and put all of this controls in an array list but This page Implement the master page which already has controls inside ,so i do not want to add these controls i want to add only the controls in the content place holders .
i will appreciate it if any one can help me ,thanks in advance .

Eslam Soliman Adam
Attached code:
public class MyBasePage : System.Web.UI.Page
{


    public ArrayList controlList = new ArrayList();
    protected override void OnLoad(EventArgs e)
    {

        ListControlCollections();
        base.OnLoad(e);
    }
    public void ListControlCollections()
    {
        ArrayList controlList = new ArrayList();

        AddControls(Page.Controls, controlList);

        foreach (string str in controlList)
        {
            Response.Write(str + "<br/>");
        }
        Response.Write("Total Controls:" + controlList.Count);
    }

    public void AddControls(ControlCollection page, ArrayList controlList)
    {
        foreach (Control c in page)
        {

           
            if (((c.ID != null) && (c.GetType().ToString().IndexOf("WebControl") >= 0)) || (c.GetType().ToString().IndexOf("CalendarControl") >= 0 || (c.GetType().ToString().IndexOf("OrienControls") >= 0)))
            {
                controlList.Add(c.ID);
            }

            if (c.HasControls())
            {
                AddControls(c.Controls, controlList);
            }
        }
    }
       
	public MyBasePage()
	{
		//
		// TODO: Add constructor logic here
		//
	}
}


modified on Wednesday, June 16, 2010 7:01 AM

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 
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 

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.