Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > ASP.NET 4 General Discussion
| Search | Today's Posts | Mark Forums Read
ASP.NET 4 General Discussion For ASP.NET 4 discussions not relating to a specific Wrox book
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 4 General Discussion 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 August 4th, 2010, 05:20 AM
Registered User
Join Date: Aug 2010
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Panel Control on FormView ASP.NET 4 Webforms

I tried to enclose part of a Formview in a Panel but it does not work.

First, I tried "spanning the tags" over the desired fields in Markup/Source, but there was an error message about Panel unable to span templates (never mind that it was just the InsertItem Template alone in use).

Then, I went to edit templates => InsertItems, and there, drew a box around the desired fields. It seemed to take, but when I inserted a Checkbox to control the Panel, and went to write the code, "Panel1" could not be found by intellisense, so I could not successfully complete the process.

Question: Can Panel Control live on Formview configured to hide just part of the form? If so, how?

Thanks in advance.
Old August 4th, 2010, 01:09 PM
Imar's Avatar
Wrox Author
Points: 70,322, Level: 100
Points: 70,322, Level: 100 Points: 70,322, Level: 100 Points: 70,322, Level: 100
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Utrecht, Netherlands.
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts

You can't access the control in the FormView directly; you need to use FindControl on the relevant template.

Google for FindControl FormView and you'll find some useful articles.


Imar Spaanjaars
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!

Similar Threads
Thread Thread Starter Forum Replies Last Post
Adding a Panel control in FormView steve35719 ASP.NET 2.0 Basics 5 August 18th, 2010 12:32 AM
ASP.NET and C# Webforms rtomanio ASP.NET 2.0 Basics 2 September 2nd, 2008 08:58 PM
Making a Panel visible in a FormView steve35719 VB How-To 0 June 29th, 2006 07:49 AM
Default Buttons - in ASP.NET webforms brameshkannan Classic ASP Professional 2 August 2nd, 2004 03:32 AM
panel in asp.net alyeng2000 ASP.NET 1.x and 2.0 Application Design 3 December 13th, 2003 01:06 PM

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