Given a URL A which gets redirected to a 3rd party website B, in my application I need to to find out URL B for the given url A and insert it in DB , this can be a windows
Uri MyUrl = Request.UrlReferrer;
Response.Write("Referrer URL Port: " + Server.HtmlEncode(MyUrl.Port.ToString()) + "
");
Response.Write("Referrer URL Protocol: " + Server.HtmlEncode(MyUrl.Scheme) + "
");
As what I understand from your question you can use a code like this so you can see the previous url and save it into db by using Linq or other ADO.NET methods.
I assume that you know how to save record in db with LINQ. If you don't please follow this link : LINQ to SQL - 5 Minute Overview
Hope it helps.