Welcome Guest! To enable all features please Login or Register.

Notification

Icon
Error

How to create complete page url with domain?
OlegO
#1 Posted : Thursday, July 29, 2010 8:06:25 PM(UTC)
Rank: Newbie
Groups: Registered

Joined: 7/28/2010(UTC)
Posts: 6
I want to add a complete url with domain to mail to reference

<a title="Send via email" target="_blank" href="mailto:?body=Thought you might like this: <%=this.Url.PageUrl("News/Detail",new{UserKey=this.GetContent("News")["UserKey"]})%>&amp;subject=<%=this.GetContent("News")["Title"]%>">email it!</a>

But PageUrl returns absolute path like
/News/Detail/News-5

How do I get complete url or current domain name?
OlegO
#2 Posted : Thursday, July 29, 2010 8:10:02 PM(UTC)
Rank: Newbie
Groups: Registered

Joined: 7/28/2010(UTC)
Posts: 6
I've found temporary solution:

<%=System.Web.HttpContext.Current.Request.Url%>
hunter007
#3 Posted : Sunday, August 29, 2010 10:15:01 PM(UTC)
Rank: Newbie
Groups: Registered

Joined: 3/15/2010(UTC)
Posts: 3


String.Format("http://{0}{1}", CachedData.GetApplication("Application name here").HostName, local_url);


use routing and UrlHelper extensions - the best

Users browsing this topic
Guest
Forum Jump  
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.

Powered by YAF 1.9.5.5 | YAF © 2003-2011, Yet Another Forum.NET
This page was generated in 0.049 seconds.