Solved

Panel is not recognized in code behind

Posted on 2007-12-05
2
267 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

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

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

This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

773 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