Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8
This is the forum to discuss the Wrox book Beginning ASP.NET 2.0 by Chris Hart, John Kauffman, David Sussman, Chris Ullman; ISBN: 9780764588501
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 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 June 12th, 2008, 05:58 AM
Authorized User
 
Join Date: Sep 2007
Posts: 48
Thanks: 0
Thanked 0 Times in 0 Posts
Default VB Ch11 Using Profiles p415 - CType

I am trying understand what the CType function does. The book introduces it on the FanClub.aspx page where user profiles are created & modified.

The sample line is quoted:
Code:
Profile.Name = CType(FCLoginView.FindControl("txtName"), TextBox).Text
And the explanation is given:
Find me the control called txtName...treat it like a TextBox control, then grab the data stored in its Text property and use that value to store in the profile.

This explanation raises more questions for me:
1) The phrase "treat it like a TextBox control" suggests that it's actually something else, but in fact it is a textbox control, so why ...?

2) Why not use something like
Code:
Profile.Name = FCLoginView.txtName.Text
3) Why is it necessary to use CType?

4) Why is it necessary to find a control?

Richard
Rugeley, UK
WinXP Pro SP2
VBW Express + SQL Server 2005 Express
__________________
Richard
Rugeley, UK
WinXP Pro SP2
VBW Express + SQL Server 2005 Express





Similar Threads
Thread Thread Starter Forum Replies Last Post
VB: Application Error in virgin Ch11 Rich57 BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 2 May 23rd, 2008 09:50 AM
Return CType(Me.GetPropertyValue("Cult thuyvncr BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 1 December 16th, 2006 11:26 AM
CType string To Byte sirmilt BOOK: Beginning Visual Basic 2005 Databases ISBN: 978-0-7645-8894-5 1 March 2nd, 2006 09:06 PM
CType Issues Dave0865 BOOK: ASP.NET Website Programming Problem-Design-Solution 3 March 23rd, 2004 12:50 PM
CType (When is it useful?) LULU VB.NET 9 October 7th, 2003 10:43 PM





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