Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics 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 May 25th, 2005, 02:53 PM
Registered User
 
Join Date: May 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default referencing controls in templates in form_view

I am having problems referencing controls and their properities the various templates in form_view. I need to set the visible property to false on a button in the item_template. I looked in the HELP section and there was a reference hyperlink called "Web Forms Control Identification" but the link is invalid. I have tried to do the following in the page_load subroutine.

dim var_deletebutton as new button
var_deletebutton = CType(me.formview1.findcontrol("bt_Delete"), button)
var_deletebutton.visible = false

I get this error when the program executes the second line of code:
"There is no source code available for the current location".

Can anyone help me?

thanks

dave potter[:

 
Old May 25th, 2005, 03:09 PM
Registered User
 
Join Date: Apr 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to MorningZ
Default

What's the reasoning for the "New" in the declaration line?

You aren't creating a button, only referencing an existing one.... so there is no "New" to:

Dim var_deletebutton As button

I'm not 100% sure if that's related to your current problem, but it might be


====================
Why do we drive on a parkway and park on a driveway?
 
Old May 25th, 2005, 03:13 PM
Registered User
 
Join Date: May 2005
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I got rid of the "NEW" but still have the same error.

any other thoughts?

 
Old May 25th, 2005, 04:23 PM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Quote:
quote:any other thoughts?
Yes, please don't cross post. I just spent some time answering this in another forum. Posting in multiple forums doesn't make things easier to track.....

Imar
---------------------------------------
Imar Spaanjaars
Everyone is unique, except for me.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Validation controls and FormView templates bpdsmark BOOK: Professional ASP.NET 2.0 and Special Edition; ISBN: 978-0-7645-7610-2; ISBN: 978-0-470-04178-9 1 September 28th, 2006 08:56 AM
CreateUserWizard -access controls inside templates vs .NET Framework 2.0 0 September 13th, 2006 09:01 PM
dynamic controls - referencing keyops VB.NET 0 February 14th, 2006 03:50 PM
Referencing Html Controls ~Bean~ ASP.NET 1.0 and 1.1 Basics 3 September 30th, 2005 09:11 AM





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