473,395 Members | 1,526 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,395 software developers and data experts.

Refer to Object in UserControl???

Can someone please tell me how I refer to a Hyperlink object in a usercontrol
from a sub in another aspx page???

I want to change the visibile attribute of a hyperlink in a user control
from an aspx page...

EG:

ASPX Page...

headerMenu.urlAdmin.visible = True

where headerMenu is the userControl name...

I get a message saying the object is not accessiable due to the fact that it
is protected????

Any ideas...

Thanks

Nov 19 '05 #1
3 1223
Change the accessibility of urlAdmin from Protected to Public, then take a
look at:
http://msdn.microsoft.com/library/de...sibilityPG.asp

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Tim::.." <myatix_at_hotmail.com> wrote in message
news:39**********************************@microsof t.com...
Can someone please tell me how I refer to a Hyperlink object in a
usercontrol
from a sub in another aspx page???

I want to change the visibile attribute of a hyperlink in a user control
from an aspx page...

EG:

ASPX Page...

headerMenu.urlAdmin.visible = True

where headerMenu is the userControl name...

I get a message saying the object is not accessiable due to the fact that
it
is protected????

Any ideas...

Thanks

Nov 19 '05 #2
Thanks...

Why do I then get this message...

Reference to a non shared member requires an object reference...
Sorry for a probably very dumb question but I'm kind of new to asp.net

Thanks again

"Karl Seguin" wrote:
Change the accessibility of urlAdmin from Protected to Public, then take a
look at:
http://msdn.microsoft.com/library/de...sibilityPG.asp

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Tim::.." <myatix_at_hotmail.com> wrote in message
news:39**********************************@microsof t.com...
Can someone please tell me how I refer to a Hyperlink object in a
usercontrol
from a sub in another aspx page???

I want to change the visibile attribute of a hyperlink in a user control
from an aspx page...

EG:

ASPX Page...

headerMenu.urlAdmin.visible = True

where headerMenu is the userControl name...

I get a message saying the object is not accessiable due to the fact that
it
is protected????

Any ideas...

Thanks


Nov 19 '05 #3
headerMenu might be the control name, but what's the intance name?

in your page you hve

Protected menu as HeaderMenu

then you should use

menu.urlAdmin
not
HeaderMenu.urlAdmin
you want the link button for the instance of your menu

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Tim::.." <myatix_at_hotmail.com> wrote in message
news:6C**********************************@microsof t.com...
Thanks...

Why do I then get this message...

Reference to a non shared member requires an object reference...
Sorry for a probably very dumb question but I'm kind of new to asp.net

Thanks again

"Karl Seguin" wrote:
Change the accessibility of urlAdmin from Protected to Public, then take
a
look at:
http://msdn.microsoft.com/library/de...sibilityPG.asp

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/
"Tim::.." <myatix_at_hotmail.com> wrote in message
news:39**********************************@microsof t.com...
> Can someone please tell me how I refer to a Hyperlink object in a
> usercontrol
> from a sub in another aspx page???
>
> I want to change the visibile attribute of a hyperlink in a user
> control
> from an aspx page...
>
> EG:
>
> ASPX Page...
>
> headerMenu.urlAdmin.visible = True
>
> where headerMenu is the userControl name...
>
> I get a message saying the object is not accessiable due to the fact
> that
> it
> is protected????
>
> Any ideas...
>
> Thanks
>


Nov 19 '05 #4

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

Similar topics

0
by: ATS | last post by:
PRB: Can not get UserControl/HTML/OBJECT to work on XP/SP2/IIS/IE6 Please help, I can not get my UserControl to work from a simple OBJECT tag in a simple HTML web page on Windows XP with SP2...
5
by: Joe Fallon | last post by:
I have a user control which can appear on many pages. The control needs to know which page it is on so it can render itself correctly. What is the best way for the control to find out what page is...
5
by: peter | last post by:
I have created an UserControl (MywindowFooter) which contains a label-component : <asp:label id="lblStatusBar" runat="server"></asp:label> How can I refer to this label, from the code-behind...
3
by: John Mason | last post by:
Hi, I am trying to work out how to make reference to an asp textbox control within a class, contained in a user control, but receive the following error... BC30469: Reference to a non-shared...
4
by: SamSpade | last post by:
If I have a class that inherits from, say RichTextBox and in the derived class I refer to Handle, does it refer to the RichTextBox class or the derived class? I'm wondering if the derived class...
3
by: j-in-uk | last post by:
I have 3 pages Site.master, Album.aspx and ContinentsMenu.ascx. Continents is a usercontrol placed in Albums. In Album.aspx.cs I need to access a property from the Continents usercontrol and is...
1
by: Nathan Sokalski | last post by:
I have a UserControl that I declare programmatically as follows: Dim userctrl as New rightside_portal() The codebehind file for this UserControl looks like the following: Partial Public...
1
by: Don | last post by:
I'm getting the following exception displayed in the task list at design time for my project: "Code generation for property 'Controls' failed. Error was: 'Object reference not set to an...
11
by: Web Search Store | last post by:
Hello, I set up a web page with 2 user controls. In classic asp, the first one did all the declarations, and the second one used the values, and could reset it. In ASP.Net so far I can't...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...

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.