views:

49

answers:

2

I 'm implementing my version of "ShareThis" in my webpage.

How can i get the client's browser displayed address with Asp.NET?

I am little confused with this one since the url to share...

1) is created with URL rewriting

2) contains Greek characters.

P.S. The client url is like example.com/ελληνικα/βιβλια

+1  A: 

Use this command, its get what is on url (even if has pass url-rewriting)

Request.RawUrl 

Of cource you can go and with javascript solution that mention here.

:) ευκολο.

Update I first answer with RawUrl because of the asp.net tag, and not any javascript tag.

Aristos
+1  A: 

You could use Javascript to help you on this one :)

Have a Javascript function to extract the url of the browser through

location.href

Just try alert(location.href) if you have a javascript debugger in your browser, it works ;)

And then alter the href attribute of the anchor () tag of your choice )

    document.getElementById('facebooksubmit').href = "facebook.com/submiturl?url=" + location.href;

To make sure this runs,

<body onload="changeurlfunction();">
Ranhiru Cooray