Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C# 1.0 > C#
C# Programming questions specific to the Microsoft C# language. See also the forum Beginning Visual C# to discuss that specific Wrox book and code.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C# section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
Old July 28th, 2006, 11:59 PM
Registered User
Join Date: Jul 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default ControlCollection class

Hello to all,
    I am creating a common module for database handling using c# & asp.net, so that for each aspx page I could use same.The requirement is like on page whatever controls are their,the id of these are database field sharing the same of column in a table.To retrive each control on page I am using ControlCollection class & stored it I am using Control class array,with this I am able to retrive the ID of control.But after retriving data in dataset from database based on their Id, I am not able to set it to the textbox as I don't get text property of textbox.If any know the same plz help me out to do so. Thanks in advance

Old July 29th, 2006, 09:13 AM
Friend of Wrox
Join Date: May 2006
Posts: 106
Thanks: 0
Thanked 0 Times in 0 Posts

u have to typecast into textbox only then u'll get text property

Old July 31st, 2006, 12:53 AM
Authorized User
Join Date: Jul 2005
Posts: 18
Thanks: 0
Thanked 0 Times in 0 Posts

Hi there,
         You need to typecaste your controls into textboxes.
Iam sending you the code snippet for you.Try this. It may be of some help. In the below program iam converting a GridView cell to hyperlink control and accessing its text property and assigning it to text variable.

string text = (((HyperLink)grdvwCell.Controls[0]).Text).ToString();

Good time ;)

Similar Threads
Thread Thread Starter Forum Replies Last Post
Using logging class as a static class punitw General .NET 0 August 14th, 2008 03:03 AM
Property access from Class within Partial Class zoltac007 C# 2005 0 December 1st, 2006 01:01 AM
Regarding Class Library (.dll) from class file manish.sharma04 BOOK: Wrox's ASP.NET 2.0 Visual Web Developer 2005 Express Edition Starter ISBN: 978-0-7645-8807-5 1 March 3rd, 2006 07:32 AM
Class disappears in the class panel hint2310 Visual C++ 0 September 18th, 2004 03:46 PM
How to include c# class and vb class in the .vbprj umeshayk VS.NET 2002/2003 2 January 9th, 2004 12:08 AM

Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.