Solved

Panel is not recognized in code behind

Posted on 2007-12-05
2
266 Views
Last Modified: 2013-12-16
In ASP.NET 2.0 with C# I have a strange error.
I decalre 2 panels in my page.
One panel I declare and then in the code behind I write
Panel1.visible = false;
I declare a second panel  'pnlbreadcr' and when I turn to it in the code behind it is recognized but I get the following error:
The name 'pnlbreadcr' does not exist in the current context      
I don't understand what is the problem. please help
Anat
0
Comment
Question by:ANAT2403
2 Comments
 
LVL 9

Accepted Solution

by:
sognoct earned 500 total points
ID: 20409685
0
 
LVL 12

Expert Comment

by:needo_jee
ID: 20409825
if you are using VS 2005 then you dont need to put definition yourself
like this
 protected System.Web.UI.WebControls.Panel pnlDescription;
but in VS 2003 (1.1) you need that.

BUT YOU MAY HAVE VISIBILITY ISSUE?
If you have put panels on a form and in form load they are set to visible=false or at the time of adding to form their visible porperty is set of false then you will not be able to access then in code for further use because controls with visible=false are not rendered in resultant HTML page (HTML is not genereated for them).

you may use a style sheet to set visibility false and true .. hope that would work for you.

Thanks
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

For those of you who don't follow the news, or just happen to live under rocks, Microsoft Research released a beta SDK (http://www.microsoft.com/en-us/download/details.aspx?id=27876) for the Xbox 360 Kinect. If you don't know what a Kinect is (http:…
A long time ago (May 2011), I have written an article showing you how to create a DLL using Visual Studio 2005 to be hosted in SQL Server 2005. That was valid at that time and it is still valid if you are still using these versions. You can still re…
This Micro Tutorial will give you a basic overview how to record your screen with Microsoft Expression Encoder. This program is still free and open for the public to download. This will be demonstrated using Microsoft Expression Encoder 4.
As a trusted technology advisor to your customers you are likely getting the daily question of, ‘should I put this in the cloud?’ As customer demands for cloud services increases, companies will see a shift from traditional buying patterns to new…

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now