?
Solved

capturing which link was clicked on so that I can dynamically build page header text.

Posted on 2004-08-21
3
Medium Priority
?
172 Views
Last Modified: 2010-04-15
I need to dynamically change/assign certian text elements in my page headers depending upon which hyperlinks my users click on. I have a page header, left navigation bar and footer. All of these sections are built using pagecontrols.

The header section in turn inherits two pagecontrols. One page control is for the navigation, the other is photo and text material. It is this photo and text material that I would like to change based upon which hyperlink is clicked in the web site. In order to do this, I believe I need to find a way to capture the link click event and then change the header pagecontrol text and photo content based upon this information.

Thanks for any help or suggestions with this.

wmsunder.
0
Comment
Question by:wmsunder
[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
3 Comments
 
LVL 1

Accepted Solution

by:
SeanStapleton earned 500 total points
ID: 11863239
For a small number of predefined links, use the asp:linkbutton control for your hyperlinks and capture the click event for each link. If you've built page controls, this should be straightforward for you. You could build a helper function, called by each click handler to do the dirty work.

Even for an unknown or variable number of links (db generated), this approach could work. As you generate the links on the page, assign the click event for each link to the same event handler.

LinkButton link;
foreach (data in some table)
{
  link = new LinkButton();
  link.Text = "My text";
  ...
  link.Click += new EventHandler(this.LinkClickHandler);
}

private void LinkClickHandler(object sender, System.EventArgs e)
{
     LinkButton clickedLink = (LinkButton)sender;
     string linkText = clickedLick.Text;
}
0
 
LVL 3

Assisted Solution

by:bigjim2000
bigjim2000 earned 500 total points
ID: 11870579
Look into the method:
Request.UrlReferrer();

It tells you the URL from which page the user came from.

-Eric
0
 

Author Comment

by:wmsunder
ID: 11919285
Problem was solved with an unrelated work-around. Points split and awarded to the two respondants.
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Extention Methods in C# 3.0 by Ivo Stoykov C# 3.0 offers extension methods. They allow extending existing classes without changing the class's source code or relying on inheritance. These are static methods invoked as instance method. This…
In order to hide the "ugly" records selectors (triangles) in the rowheaders, here are some suggestions. Microsoft doesn't have a direct method/property to do it. You can only hide the rowheader column. First solution, the easy way The first sol…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…
Suggested Courses

752 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