Stephen2
94 posts
Registered:
05 Feb 2012
14 Dec 2013
in reply to
Stephen2
Link to this post
Thinking about it you should use Page.Title instead of node.Title because:
Some widgets in Sitefinity replace the Page.Title (e.g., on a News Item page)
Be careful though, because this Title replacement is done after the Page_Load event for your UserControl
I would suggest interrogating Page.Title during the Page_PreRender event, so your control would be something like (I just wrote this from my head, but be aware of the URL encoding I guess is important)...
Page_PreRender(object sender, EventArgs e) {
myLink.NavigateUrl = HttpServerUtility.UrlEncode(string.Format("http://twitter.com/share?url={0}&text={1}", Page.Request.Url.AbsoluteUri, Page.Title));
}