开发者

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

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

How can i get the client's browser dis开发者_Go百科played 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/ελληνικα/βιβλια


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.


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();">
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜