Click here to Skip to main content
15,790,267 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Suppose i am standing on and there is a link on my site of so whenever user click on the it will show that he/she has requested for that url...
how can i do this by c# in
Updated 2-May-23 17:23pm
Homero Rivera 23-Nov-13 19:02pm    
Not clear enough. Is owned by you? Do you code Or do you only own and want to track if you came from any given site?

If you own and can code on it, you can add URL parameters and fetch them on like . You can also add a cookie when they click on the link in and fetch the cookie instead.
If you don't own/code from, you can check the users browsing history with javascript with window.history .

Which is your scenario?
Arkadeep De 24-Nov-13 0:16am    
i own that....
Karthik_Mahalingam 26-Nov-13 11:07am    
question not clear,
please explain in details. so that we can work on that to get ur issue solved..
PDBHONGAON 5-Dec-13 0:02am    
if you want to show the destination page of the link then you can -
Use a query string.
Get HTTP POST information from the source page.
mtoha 2-May-23 22:13pm    
What kind of project? mvc? webform? What is the version of .NET?

Use This
String RequestedPage = Request.PhysicalPath.Replace(Request.PhysicalApplicationPath, "");

Might Be Helpful. I Used It For Page Wise Security In My Web Application.
Share this answer
If You are using MVC, the backend code is something like this.

public RedirectResult LogToDbRedirect()
   string username = HttpContext.Session.GetString("username");
  //Save to DB
  SaveToLog(username, "", "" );
  return Redirect("");

You need 1 table to save url click log, containing columns:
Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900