locked
siteMapNode RRS feed

  • Question

  • User-305496339 posted

    Hi Friends,

    for some strange reason I cant get my outlook to open from my asp.net website using the following line of code?

    <siteMapNode title="Report Fraud" url="mailto:fraud@nyesc.state.ny.us" roles="*"  description="Report Fraud"/>

    Is this supposed to work or is there a work around? Thanks !!!

    Friday, April 17, 2020 9:02 PM

Answers

  • User-719153870 posted

    Hi rkrex,

    This code works for me, can you provide your .sitemap code? And did you receive error message when you say "I cant get my outlook to open", especially check your browser devtools?

    Below is mine which works well:

    <?xml version="1.0" encoding="utf-8" ?>
    <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
      <siteMapNode title="Report Fraud" url="mailto:fraud@nyesc.state.ny.us" roles="*"  description="Report Fraud">
        <siteMapNode url="SiteMapDemo.aspx" title="SiteMapDemo"  description="SiteMapDemo"></siteMapNode>
      </siteMapNode>
    </siteMap>

    result:

    Best Regard,

    Yang Shen

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, April 18, 2020 2:38 AM
  • User475983607 posted

    Keep in mind, your solution only works if the user has Outlook installed on their PC and Outlook is the default email client.  These days Internet email is very common so your design might not work for all users.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, April 18, 2020 11:50 AM
  • User-305496339 posted

    The below anchor tag with link inside of it works fine. 

     <a href="mailto:fraud@nyesc.state.ny.us">Click Here To Report Fraud</a>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, April 18, 2020 12:31 PM

All replies

  • User-719153870 posted

    Hi rkrex,

    This code works for me, can you provide your .sitemap code? And did you receive error message when you say "I cant get my outlook to open", especially check your browser devtools?

    Below is mine which works well:

    <?xml version="1.0" encoding="utf-8" ?>
    <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
      <siteMapNode title="Report Fraud" url="mailto:fraud@nyesc.state.ny.us" roles="*"  description="Report Fraud">
        <siteMapNode url="SiteMapDemo.aspx" title="SiteMapDemo"  description="SiteMapDemo"></siteMapNode>
      </siteMapNode>
    </siteMap>

    result:

    Best Regard,

    Yang Shen

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, April 18, 2020 2:38 AM
  • User-305496339 posted

    Thank You for your help. You dont see it when I copied and pasted my code into my reply, but I noticed that my url was underlined. Do you think that may be the problem? I don't get any error meassages and what do you mean by browser devtools?

    <?xml version="1.0" encoding="utf-8" ?>
    <siteMap xmlns="http://schemas.microsoft.com/AspNet/SiteMap-File-1.0" >
      <siteMapNode url="~" title="Account Services">
        <siteMapNode url="~/Default.aspx" title="User Log In"/>
        <siteMapNode url="~/Access/Default.aspx" title="Create New User Id (Registration)" />
         <siteMapNode url="~/Access/RetrievePassword.aspx" title="Reset Password" />
        <siteMapNode url="~/Access/RetrieveUserName.aspx" title="Retrieve User Id" />
        <siteMapNode url="~/Help/InstructionalVideo.aspx"  title="Instructional Video" />
        <siteMapNode title="Report Fraud" url="mailto:fraud@nyesc.state.ny.us"
    roles="*"  description="Report Fraud"/>
       </siteMapNode>
    </siteMap>

    Saturday, April 18, 2020 11:20 AM
  • User475983607 posted

    Keep in mind, your solution only works if the user has Outlook installed on their PC and Outlook is the default email client.  These days Internet email is very common so your design might not work for all users.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, April 18, 2020 11:50 AM
  • User-305496339 posted

    The below anchor tag with link inside of it works fine. 

     <a href="mailto:fraud@nyesc.state.ny.us">Click Here To Report Fraud</a>

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Saturday, April 18, 2020 12:31 PM
  • User475983607 posted

    The below anchor tag with link inside of it works fine. 

     <a href="mailto:fraud@nyesc.state.ny.us">Click Here To Report Fraud</a>

    For the second time.  The mailto: link opens the default email client on the user's machine.  This approach will only work on an Intranet application where you have control over the what applications are installed on the user's machine.  If this is an internet application then you'll need to redesign and send emails from the web server.

    I also created a  site with a mailto link and cannot reproduce your results.

    Saturday, April 18, 2020 12:48 PM
  • User-305496339 posted

    Yes, this is work related and I am very much aware of what you said about this will work in a controlled environment. But thtas not really addressing the issue that my machine has outlook and I cant get the email link to work in a SiteMapNode. Thank You !!!!

    Saturday, April 18, 2020 1:18 PM
  • User475983607 posted

    rkrex

    Yes, this is work related and I am very much aware of what you said about this will work in a controlled environment. But thtas not really addressing the issue that my machine has outlook and I cant get the email link to work in a SiteMapNode. Thank You !!!!

    The forum is a disconnected platform where forum members can only see what you share.   My point is your approach is very fragile.  I do not recommend this approach and this approach would fail a code review at my organization.  A much better approach is providing the user a standard form to populate an email message.  Send the email from the server.  This approach is not dependent on your work environment.

    Keep in mind, two forum members created a demo and cannot reproduce this issue.  There must be a coding bug elsewhere in your project.  Have you tried basic troubleshooting using the standard development tools?  

    I recommend viewing the HTML source and taking a look at the email link.  Is the link formatted correctly?  Open the browser's dev tools by pressing F12.  Do you see any JavaScript errors?  Create a minimal demo by adding a new web form page to test the site map using the sample code from Yang Shen's post.  If the sample code works then take a closer look at your code.

    Saturday, April 18, 2020 1:34 PM
  • User-305496339 posted

    Thanks I will try that. How did you say best practice  for doing this in your organization would work? And could you please be as detailed as possible. You have helped me on a lot of posts and maybe you would be available for tutoring for a fee. Thanks Again, I greatly Appreciate your help and sharing your very valuable time. 

    Saturday, April 18, 2020 1:43 PM
  • User-719153870 posted

    Hi rkrex,

    Has the solution been resolved? Did you find any error message in your devtools?

    If it's solved now, you can mark the posts in this thread that helps. Or you can keep follow this thread with new situations you met if it's not solved.

    Best Regard,

    Yang Shen

    Monday, April 20, 2020 1:21 AM