Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / Building Controls / April 2006

Tip: Looking for answers? Try searching our database.

Iterate through page controls

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Avon - 23 Apr 2006 22:33 GMT
Hi friends,

I need of some help,

I have this code:

For Each t As TextBox In Page.Controls ' here is the error

   t.Text = "test"

Next

But I am getting this error:

Unable to cast object of type 'ASP.masterpages_maindesign_master' to type
'System.Web.UI.WebControls.TextBox'.

Please help me to understand this error and solve the problem

Thanks in advance
Sebastian - 24 Apr 2006 09:09 GMT
Hi Avon,

"Page.Controls" - you're probably in your masterpage and trying to interate
througth masterpage controls (placeholders). Try to interate t. your content
control.

Hope it helps,
Sebastian

> Hi friends,
>
[quoted text clipped - 16 lines]
>
> Thanks in advance

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2009 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.