473,320 Members | 1,987 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

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 1465
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
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.