I'm not looking for the solution using SPContext & so. I tried it but I can't get URLs like:
http://mypage.com/testblog/Lists/Posts/Post.aspx?ID=1 )
thanks george
ps: I forgot to mention that this is about a MS Sharepoint 2010 Visual Webpart
and I'm programming in C#
Tell me more
×
SharePoint Stack Exchange is a question and answer site for
SharePoint enthusiasts. It's 100% free, no registration required.
|
|
|||||
|
|
|
|||||||
|
|
For a C# solution you could use HttpRequest.Url, that may get you the full current URL, or otherwise get the Url property form SPContext.Current. |
|||
|
|
|
You could use jQuery to get the path and display it. $(document).ready(function() { var pathname = window.location.pathname; }); |
|||
|
|
|
Lori's answer will work, but if you haven't already loaded jQuery to do something else then it's probably just a waste of overhead to load it just for this purpose. You can grab it with straight JavaScript:
|
|||
|