Solved

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

Posted on 2004-08-21
3
165 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
3 Comments
 
LVL 1

Accepted Solution

by:
SeanStapleton earned 125 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 125 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

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

Suggested Solutions

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…
We all know that functional code is the leg that any good program stands on when it comes right down to it, however, if your program lacks a good user interface your product may not have the appeal needed to keep your customers happy. This issue can…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

708 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

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now