p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   ASP.NET 4 General Discussion (http://p2p.wrox.com/forumdisplay.php?f=561)
-   -   Panel Control on FormView ASP.NET 4 Webforms (http://p2p.wrox.com/showthread.php?t=80366)

oguchi August 4th, 2010 05:20 AM

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.

Imar August 4th, 2010 01:09 PM

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.



All times are GMT -4. The time now is 07:12 AM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.