AspdotnetCodes.com
Search
Articles
Books
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
 why can't access run time control on page when using Master Page?
Posted by A.Goodarzi on  5/12/2010 1:32:24 AM Category: Asp.Net 2.0
Add to my favorites
Email to friend
Hi all:
I create the HtmlTable (id="tb") in PlaceHolder (id="ph1"). but i cant access the Table and contoles into its.
Control c = Page.FindControl("ctl00$ContentPlaceHolder1$ph1");
c is not null,
Control c2 = c.FindControl("tb");
but c2 is null.

please Help me. tanks

Post Your Reply Post New Question

 Viewer's Reply
Runat Server controls - Creating controls at runtime
Answered By Moderator1 on 5/12/2010 9:41:45 AM
Hi,

Run-time created controls should be placed at proper event, and declared properly in the code-behind section.. Then only you can access those controls at run-time.

But you are trying to access the td of a Html Table.. Make sure it is rendered properly at run time and check it contents.. Then try to access it.
 
Post Your Reply If you still have problem, post it again under this reply for better response.

 
Sponsored by
Backup and Recovery Best Practices for Microsoft SQL Server 2005
Windows 8: 50 Questions and Answers You Need to Make a Decision (Normally $9.95)
Easing the Migration to Microsoft SQL Server 2005