Solved

Panel is not recognized in code behind

Posted on 2007-12-05
2
265 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
Comment Utility
0
 
LVL 12

Expert Comment

by:needo_jee
Comment Utility
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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Entity Framework is a powerful tool to help you interact with the DataBase but still doesn't help much when we have a Stored Procedure that returns more than one resultset. The solution takes some of out-of-the-box thinking; read on!
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.

772 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

11 Experts available now in Live!

Get 1:1 Help Now