Hi Dave,
Thank you for your update.
Besides using your way to find the ContentPlaceHolder control and get the
child controls, I think using the recursive way to find the DropDownList
should work too since when compiled, the master page and the content page
will get merged.
You can verify this by turning on trace output of the content page:
<%@ Page Language="VB" MasterPageFile="~/MasterPage.master"
AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2"
title="Untitled Page" Trace="true" %>
And view the page, you will see the control hierarchy such as:
__Page ASP.default2_aspx 1411 0 0
ctl00 ASP.masterpage_master 1411 0 0
ctl00$ctl02 System.Web.UI.LiteralControl 175 0 0
ctl00$ctl00 System.Web.UI.HtmlControls.HtmlHead 46 0 0
ctl00$ctl01 System.Web.UI.HtmlControls.HtmlTitle 33 0 0
ctl00$ctl03 System.Web.UI.LiteralControl 14 0 0
aspnetForm System.Web.UI.HtmlControls.HtmlForm 1156 0 0
ctl00$ctl04 System.Web.UI.LiteralControl 21 0 0
ctl00$ContentPlaceHolder1
System.Web.UI.WebControls.ContentPlaceHolder 746 0 0
ctl00$ContentPlaceHolder1$ctl00
System.Web.UI.LiteralControl 21 0 0
ctl00$ContentPlaceHolder1$DropDownList1
System.Web.UI.WebControls.DropDownList
So passing "Me" to the function I've written will correctly walk down all
the child controls.
Hope this helps. Please feel free to post here if anything is unclear.
Regards,
Walter Wang (
[email protected], remove 'online.')
Microsoft Online Community Support
==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.