Don't miss out Virtual Happy Hour this Friday (April 26).

Try our conversational search powered by Generative AI!

Problems creating mailto: link in repeater

Vote:
 
We have a repeater that work against another database than the EPiServer from wich we display our staff on the contact page. I try to make the emailaddress show as a mailto:-link but then i run into problem. First the code
  • <%# databinder.eval(container.dataitem, "strfirstname") %> <%# databinder.eval(container.dataitem, "strsurname") %>
    <%# databinder.eval(container.dataitem, "strstafffunctionname") %>
    <%# databinder.eval(container.dataitem, "strphone") %> <%# databinder.eval(container.dataitem, "strfax") %>
    "><%# databinder.eval(container.dataitem, "stremail") %>
  • Then the Error message Exception details: UriFormatException: Invalid URI: The hostname could not be parsed. Stack trace: [UriFormatException: Invalid URI: The hostname could not be parsed.] at System.Uri.CreateHostStringHelper(String str, UInt16 idx, UInt16 end, Flags& flags, String& scopeId) at System.Uri.CreateHostString() at System.Uri.EnsureHostString(Boolean allowDnsOptimization) at System.Uri.GetComponentsHelper(UriComponents uriComponents, UriFormat uriFormat) at System.Uri.GetComponents(UriComponents components, UriFormat format) at System.Uri.get_Host() at System.UriBuilder.Init(Uri uri) at System.UriBuilder..ctor(Uri uri) at EPiServer.UrlBuilder.Init(Uri url) at EPiServer.UrlBuilder.get_ThisBuilder() at EPiServer.UrlBuilder.get_QueryCollection() at EPiServer.Web.PermanentLinkUtility.GetPageReference(UrlBuilder mappedUrl) at EPiServer.Web.FriendlyHtmlRewriteToExternal.HtmlRewriteUrl(UrlBuilder internalUrl, UrlBuilder externalUrl, UrlBuilder url, Encoding encoding, Object& internalObject) at EPiServer.Web.FriendlyHtmlRewriteToExternal.rewritePipe_HtmlRewriteUrl(Object sender, HtmlRewriteEventArgs e) at EPiServer.Web.RewritePipe.OnHtmlRewriteUrl(HtmlRewriteEventArgs e) at EPiServer.Web.HtmlRewritePipe.WriteElement(MyHtmlRewriteEventArgs e, SgmlReader reader, TextWriter writer) at EPiServer.Web.HtmlRewritePipe.RewriteToEnd(TextReader reader, TextWriter writer) at EPiServer.Web.HtmlRewriteStream.Close() at System.Web.HttpWriter.Filter(Boolean finalFiltering) at System.Web.HttpResponse.FilterOutput() at System.Web.HttpApplication.CallFilterExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) If i delete the mailto: string everything works except that the links now looks like regular links i.e http://www.domain.com/templates/email@mail.com wich of course don't work. Anyone now how to fix this?
    #15900
    Nov 28, 2007 12:21
    Vote:
     
    Could you try to change defaultProvider to EPiServerNullUrlRewriteProvider and test. I would like to see acutal html code that is generated... Regards, Fredrik Haglund, INEXOR AB http://blog.fredrikhaglunds.se
    #16598
    Nov 28, 2007 13:12
    Vote:
     
    Don't know what code you're looking for but it works with the settings you provided and you can see for yourself at http://www1.elmia.se/Templates/Public/Pages/ContactPage.aspx?id=141&epslanguage=sv
    #16599
    Nov 30, 2007 8:06
    Vote:
     
    Yes, I can see that the page renders and the "mailto:" link looks as it should. Please note that the change you have done disables the whole friendly url schema. You will get ugly urls with ID all over the site if you do not change it back. So, I recommend that you contact EPiServer support because this is a probably a defect in the FriendlyUrlRewrite module that they would like to fix. And one more general comment. I strongly advice not to use mailto-links because you will get so much spam to theese addresses. Use a feedback form or a good chaptcha to protect your addresses like this free service: http://mailhide.recaptcha.net/ Sincerly, Fredrik Haglund INEXOR AB http://blog.fredrikhaglund.se
    #16600
    Dec 03, 2007 17:02
    This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
    * You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.