?
Solved

Panel is not recognized in code behind

Posted on 2007-12-05
2
Medium Priority
?
276 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 9

Accepted Solution

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

Expert Comment

by:Munawar Hussain
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

Not sure which OpenStack Certification to get?

So you’ve realized you might want to get certified in OpenStack, but you’re not sure what the benefits might be or even which one you should take. You know there are several certification courses you can choose from, but how do you know which one is right for you?

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…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
Suggested Courses

801 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