<p>I need to be able to get at the full URL of the page I am on from a user control.  Is it just a matter of concatenating a bunch of Request variables together?  If so which ones? Or is there a more simpiler way?</p>

[{'answer_id': 40683, 'author': 'FlySwat', 'author_id': 1965, 'author_profile': 'https://Stackoverflow.com/users/1965', 'pm_score': 3, 'selected': False, 'text': '<p>Request.RawUrl</p>\n'}, {'answer_id': 40693, 'author': 'Christian Hagelid', 'author_id': 202, 'author_profile': 'https://Stackoverflow.com/users/202', 'pm_score': 3, 'selected': False, 'text': '<p>if you need the full URL as everything from the http to the querystring you will need to concatenate the following variables</p>\n\n<pre><code>Request.ServerVariables("HTTPS") // to check if it\'s HTTP or HTTPS\nRequest.ServerVariables("SERVER_NAME") \nRequest.ServerVariables("SCRIPT_NAME") \nRequest.ServerVariables("QUERY_STRING")\n</code></pre>\n'}, {'answer_id': 40718, 'author': 'RedWolves', 'author_id': 648, 'author_profile': 'https://Stackoverflow.com/users/648', 'pm_score': 3, 'selected': False, 'text': '<p>Thanks guys, I used a combination of both your answers @Christian and @Jonathan for my specific need.</p>\n\n<pre><code>"http://" + Request.ServerVariables["SERVER_NAME"] +  Request.RawUrl.ToString()\n</code></pre>\n\n<p>I don\'t need to worry about secure http, needed the servername variable and the RawUrl handles the path from the domain name and includes the querystring if present.</p>\n'}, {'answer_id': 41149, 'author': 'travis', 'author_id': 1414, 'author_profile': 'https://Stackoverflow.com/users/1414', 'pm_score': 8, 'selected': True, 'text': '<p>I usually use <code>Request.Url.ToString()</code> to get the full url (including querystring), no concatenation required.</p>\n'}, {'answer_id': 41199, 'author': 'DevelopingChris', 'author_id': 1220, 'author_profile': 'https://Stackoverflow.com/users/1220', 'pm_score': 6, 'selected': False, 'text': '<pre><code>Request.Url.AbsoluteUri\n</code></pre>\n\n<p>This property does everything you need, all in one succinct call.</p>\n'}, {'answer_id': 20353567, 'author': 'IonB', 'author_id': 3061797, 'author_profile': 'https://Stackoverflow.com/users/3061797', 'pm_score': 1, 'selected': False, 'text': '<p>If you need the port number also, you can use</p>\n\n<pre><code>Request.Url.Authority\n</code></pre>\n\n<p>Example:</p>\n\n<pre><code>string url = Request.Url.Authority + HttpContext.Current.Request.RawUrl.ToString();\n\nif (Request.ServerVariables["HTTPS"] == "on")\n{\n    url = "https://" + url;\n}\nelse \n{\n    url = "http://" + url;\n}\n</code></pre>\n'}, {'answer_id': 21226409, 'author': 'Mohsen', 'author_id': 1989454, 'author_profile': 'https://Stackoverflow.com/users/1989454', 'pm_score': 8, 'selected': False, 'text': '<p>Here is a list I normally refer to for this type of information:</p>\n\n<pre><code>Request.ApplicationPath :   /virtual_dir\nRequest.CurrentExecutionFilePath :  /virtual_dir/webapp/page.aspx\nRequest.FilePath :  /virtual_dir/webapp/page.aspx\nRequest.Path :  /virtual_dir/webapp/page.aspx\nRequest.PhysicalApplicationPath :   d:\\Inetpub\\wwwroot\\virtual_dir\\\nRequest.QueryString :   /virtual_dir/webapp/page.aspx?q=qvalue\nRequest.Url.AbsolutePath :  /virtual_dir/webapp/page.aspx\nRequest.Url.AbsoluteUri :   http://localhost:2000/virtual_dir/webapp/page.aspx?q=qvalue\nRequest.Url.Host :  localhost\nRequest.Url.Authority : localhost:80\nRequest.Url.LocalPath : /virtual_dir/webapp/page.aspx\nRequest.Url.PathAndQuery :  /virtual_dir/webapp/page.aspx?q=qvalue\nRequest.Url.Port :  80\nRequest.Url.Query : ?q=qvalue\nRequest.Url.Scheme :    http\nRequest.Url.Segments :  /\n    virtual_dir/\n    webapp/\n    page.aspx\n</code></pre>\n\n<p>Hopefully you will find this useful!</p>\n'}, {'answer_id': 22373623, 'author': 'Artem', 'author_id': 1713814, 'author_profile': 'https://Stackoverflow.com/users/1713814', 'pm_score': 3, 'selected': False, 'text': '<p>Better to use <a href="http://msdn.microsoft.com/en-us/library/system.uri.originalstring.aspx" rel="noreferrer"><code>Request.Url.OriginalString</code></a> than <code>Request.Url.ToString()</code> (according to <a href="http://msdn.microsoft.com/en-us/library/system.uri.tostring.aspx" rel="noreferrer">MSDN</a>)</p>\n'}, {'answer_id': 46311534, 'author': 'Serj Sagan', 'author_id': 550975, 'author_profile': 'https://Stackoverflow.com/users/550975', 'pm_score': 5, 'selected': False, 'text': "<p>For <code>ASP.NET Core</code> you'll need to spell it out:</p>\n<pre><code>var request = Context.Request;\n@($&quot;{ request.Scheme }://{ request.Host }{ request.Path }{ request.QueryString }&quot;)\n</code></pre>\n<p>Or you can add a using statement to your view:</p>\n<pre><code>@using Microsoft.AspNetCore.Http.Extensions\n</code></pre>\n<p>then</p>\n<pre><code>@Context.Request.GetDisplayUrl()\n</code></pre>\n<p>The <code>_ViewImports.cshtml</code> might be a better place for that <code>@using</code></p>\n"}, {'answer_id': 54899250, 'author': 'Abhishek Kanrar', 'author_id': 8520016, 'author_profile': 'https://Stackoverflow.com/users/8520016', 'pm_score': 1, 'selected': False, 'text': "<p>Try the following -</p>\n\n<pre><code>var FullUrl = Request.Url.AbsolutePath.ToString();\nvar ID = FullUrl.Split('/').Last();\n</code></pre>\n"}]
['https://Stackoverflow.com/questions/40680', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/648/']