473,473 Members | 1,984 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Trying to hide a user control

We use a user control, SCMMenu.ascx, as our menu at the top of our web
pages. Under some circumstances we need to hide the menu.

At the top of the (.aspx) page we register the control with:
<%@ Register TagPrefix="eSCM" TagName="ctrlSCMMenu"
Src="/eSoftware/Common/SCMMenu.ascx" %>

At the place in the HTML where the control appears we have:
<escm:ctrlscmmenu id="ctrlSCMMenu" name="ctrlSCMMenu" runat="server"
Visible="True"></escm:ctrlscmmenu>

This is pretty standard stuff, and it works, What I want to do is place code
in the code-behind file that can hide the user control. I thought I could do
it with
ctrlSCMMenu.visible = false

but I get a syntax error claiming that the name ctrlSCMMenu has not been
declared. Any ideas?

Much obliged.
Jul 28 '05 #1
2 1472
You should manually declare usercontrols. VS.NET does not create any
declaration automatically like when you put a TextBox on the page. Be
careful about using exactly the same name.

Good Luck.

Jul 28 '05 #2
OK, thanks, got it. I added
Public ctrlSCMMenu As New UserControl
as a class variable in my code-behind and that took care of it.

Geoff.

"dincerozturan" <di************@bizitek.com.tr> wrote in message
news:11**********************@o13g2000cwo.googlegr oups.com...
You should manually declare usercontrols. VS.NET does not create any
declaration automatically like when you put a TextBox on the page. Be
careful about using exactly the same name.

Good Luck.

Jul 28 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Steve | last post by:
Visual Studio 2003 C# Windows: I have a tree view control as my main menu control down the left side of my application. This has 2 Parent Nodes on it (Jobs and Employees). beneath these 2 main...
3
by: Lynn | last post by:
Hello, I have a user control that contains a table, and some text fields. I would like to show or hide a particular row of this table, based on a selection the user makes on my page. Here's...
2
by: Geoff Pennington | last post by:
We use a user control, SCMMenu.ascx, as our menu at the top of our web pages. Under some circumstances we need to hide the menu. At the top of the (.aspx) page we register the control with: <%@...
5
by: Mike TI | last post by:
March 24, 2006 Hi all I am new to VB.NET and am using VB.NET 2005. I have an MDI form with a Split Container Control. On demand I am adding and removing User Controls on Panel 2. I am using...
1
by: kmercer46 | last post by:
I need to hide the user control by checking a small if condition.If the condition is false then then the user control is set TRUE,else It should be FALSE.How can i do it in the ASP.NET with VB.NET...
6
by: --== Alain ==-- | last post by:
Hi, I derived a control to create my custom control. However, some of the control base properties are useless from my point of view and i would like to avoid control user to change them. How...
3
by: deciacco | last post by:
I'm trying to write a label printing SDI app with a small preview on the main form itself. Every time I run the InvalidatePreview event on the preview control to redraw the preview I get the...
10
by: sara | last post by:
Hi - Is it possible to hide the detail section of a report at run time? I have a report that prints all details, with summary lines. The user would like the report ALSO with just summary lines....
6
by: Doogie | last post by:
Hi I have an img control I am trying to hide upon certain types of commands in my code behind. When to hide it is directly tied to a asp:dropdownlist control. So depending on what the user...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
1
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.