Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hi,
This isn't an xslt question, but I'm not sure where else to post it. Anyhow, I'm adding a bookmark tool to my pages and need to grab the current page URL inline in the template code. Currently I have this:
<a href="http://del.icio.us/post?url=<%=Request.ServerVariables["SCRIPT_NAME"]%>"><img src="/media/123/delicious.png" /></a>
However, that just yeilds the following output:
<a href="http://del.icio.us/post?url=/my-page.aspx"><img src="/media/123/delicious.png" /></a>
I need it to output the full URL:
<a href="http://del.icio.us/post?url=http://www.my-site.com/directory/my-page.aspx"><img src="/media/123/delicious.png" /></a>
Does anyone know how this can be done?
Thanks
I think you have to do two Requests. One for the server name and one for the file, and also add the protocol you are using.
Something like this:
<a href="http://del.icio.us/post?url=http://<%= Request.ServerVariables("SERVER_NAME") +Request.ServerVariables["SCRIPT_NAME"] %>"><img src="/media/123/delicious.png" /></a>
/Fredrik
Try Request.Url but next time you should use google first :-)
http://www.dotnetfunda.com/articles/article79.aspx
Thanks Fredrik, that works fine. Petr, of course I Googled first. I tried using 'Request.URL' but couldn't get it to work.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Get current URL in ASP.NET
Hi,
This isn't an xslt question, but I'm not sure where else to post it. Anyhow, I'm adding a bookmark tool to my pages and need to grab the current page URL inline in the template code. Currently I have this:
However, that just yeilds the following output:
I need it to output the full URL:
Does anyone know how this can be done?
Thanks
Hi,
I think you have to do two Requests. One for the server name and one for the file, and also add the protocol you are using.
Something like this:
/Fredrik
Try Request.Url but next time you should use google first :-)
http://www.dotnetfunda.com/articles/article79.aspx
Thanks Fredrik, that works fine. Petr, of course I Googled first. I tried using 'Request.URL' but couldn't get it to work.
is working on a reply...