473,402 Members | 2,061 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,402 software developers and data experts.

Access controls in Web User Control from web form

Hi,

I am a newbie, so some help here would be very appreciated!

I have a aspx-page with four links at the top of the page. These links
are the application navigation and they are stored in a separate Web
User Control(ctrlTop.ascx).
These four links are added as asp:Hyperlink, with an ImageUrl set as
well. So the links are displayed as images.

When browsing my application I want to show the user in what section
he/she is by highlighting that image(hyperlink) in the navigation on
the top(my Web User Control).
To do this I want to change the ImageUrl on that hyperlink to another
image.

So in other words, when loading an aspx page I want to change an
ImageUrl on a control in a Web User Control.

How do I do that?

And once again, I am a beginner, so if you have a code exampel please
show it here.

Thanks in advance!

/Jocke
Nov 18 '05 #1
2 1657
protected System.Web.UI.WebControls.HyperLink HyperLink;

private void Header_Load(object sender, System.EventArgs e)

{

if(Page.IsPostBack != true)

{

HyperLink.ImageUrl = Application["ApplicationPath"]+"images/tm_triad.gif";

}

}

"Joachim Feldt" <jo***********@astrazeneca.com> wrote in message news:35*************************@posting.google.co m...
Hi,

I am a newbie, so some help here would be very appreciated!

I have a aspx-page with four links at the top of the page. These links
are the application navigation and they are stored in a separate Web
User Control(ctrlTop.ascx).
These four links are added as asp:Hyperlink, with an ImageUrl set as
well. So the links are displayed as images.

When browsing my application I want to show the user in what section
he/she is by highlighting that image(hyperlink) in the navigation on
the top(my Web User Control).
To do this I want to change the ImageUrl on that hyperlink to another
image.

So in other words, when loading an aspx page I want to change an
ImageUrl on a control in a Web User Control.

How do I do that?

And once again, I am a beginner, so if you have a code exampel please
show it here.

Thanks in advance!

/Jocke

Nov 18 '05 #2
Hello Enrique,

Why would you store this in an Application level variable? This supposes
that you want the triad.gif to show on the same link for every user in the
entire application.

Perhaps a better spot would be Session, as it is user-specific...

--
Matt Berther
http://www.mattberther.com
protected System.Web.UI.WebControls.HyperLink HyperLink;

private void Header Load(object sender, System.EventArgs e)

{

if(Page.IsPostBack != true)

{

HyperLink.ImageUrl =
Application["ApplicationPath"]+"images/tm triad.gif";
}

}

"Joachim Feldt" <jo***********@astrazeneca.com> wrote in message
news:35*************************@posting.google.co m...
Hi,

I am a newbie, so some help here would be very appreciated!

I have a aspx-page with four links at the top of the page. These
links
are the application navigation and they are stored in a separate Web
User Control(ctrlTop.ascx).
These four links are added as asp:Hyperlink, with an ImageUrl set as
well. So the links are displayed as images.
When browsing my application I want to show the user in what section
he/she is by highlighting that image(hyperlink) in the navigation on
the top(my Web User Control).
To do this I want to change the ImageUrl on that hyperlink to another
image.
So in other words, when loading an aspx page I want to change an
ImageUrl on a control in a Web User Control.

How do I do that?

And once again, I am a beginner, so if you have a code exampel please
show it here.

Thanks in advance!

/Jocke

Nov 18 '05 #3

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

Similar topics

6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
6
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much...
49
by: Yannick Turgeon | last post by:
Hello, We are in the process of examining our current main application. We have to do some major changes and, in the process, are questionning/validating the use of MS Access as front-end. The...
6
by: MS | last post by:
Access 97 here. I want a simple way to "lock" certain records on a form. Some records remain "live" until all data is available which happens over time. When all the fields are complete, I want...
2
by: paul meaney | last post by:
All, myself and another developer have been staring blankly at a screen for the past 48 hours and are wondering just what stunningly obvious thing we are missing. We are trying to load up 2...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
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...

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.