Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7368475
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T03:41:01+00:00 2026-05-29T03:41:01+00:00

I am trying to create an email link using MVC3 and strongly typed modeling.

  • 0

I am trying to create an email link using MVC3 and strongly typed modeling. I want the subject of the email to contain the # sign similar to:

Request #56

My initial attempt looked like:

<a href = "mailto:@Model.Email?subject=Request #@Model.ID">@Model.Name</a>

It resulted in what I thought was perfect HTML:

<a href="mailto:john.stone@nowhere.com?subject=Request #5">John Stone</a>

I found out that Internet Explorer does not like the # sign in the subject. If I clicked on the above “link”, the subject would be set to:

Request

After searching here, I found that I needed to use %23 in place of the #. So my second attempt looked like:

<a href = "mailto:@Model.Email?subject=Request %23 @Model.ID">@Model.Name</a>

This resulted in the following:

Request # 56

Close but I do not want the space between the # and the number.

How do I properly use the # key without a space?

I am using MVC3 and trying to get this to work in IE8.

*added some details about the first attempt resulting html and how IE handles the subject

SOLUTION
There are actually two issues going on.

The first is IE will not allow the # in the subject text. So any instance of the # needs to be replaced with %23.

The second is the MVC3 parser does NOT handle #23@Model.ID correctly. It will NOT substitue in the value of Model.ID.

The correct solution is noted below but to “cut and paste”:

@{   
   string requestValue = "%23" + Model.ID.ToString()
}  
<a href = "mailto:@Model.Email?subject=Request @requestValue">@Model.Name</a>

The above will generate a properly clickable href mail link that would look like:

<a href="mailto:john.stone@nowhere.com?subject=Request %235">John Stone</a>

When the above is clicked, the subject of the email will be “Request #5”.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T03:41:03+00:00Added an answer on May 29, 2026 at 3:41 am

    You can use an inline C# statement.

    @{
      string requestValue = "#" + Model.ID.ToString() // or "%23"
    }
    
    <a href = "mailto:@Model.Email?subject=Request @requestValue">@Model.Name</a> 
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Am trying to create a link to create an email to send information to
I am trying to create a link that can be sent via email which
I am trying to create a link in an email so our users can
I'm trying to create a Email to friend page using php. The objective of
I'm trying to create a link to a file to put into an email
I am trying to use the System.Net.Mail.MailMessage class in C# to create an email
I'm trying to create a regular expressions that will filter valid emails using PHP
I'm trying create a bot which automatically likes Facebook posts. Using Mechanize I can
Ok so I am trying create a login script, here I am using PHP5
Trying to create several layers of folders at once C:\pie\applepie\recipies\ without using several different

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.