简体   繁体   中英

Concatenating anchor tag within HTML

This:

"<a href='http://localhost:6171/activity/index/?Id='" + x.EmpId + "&date=" + DateTime.Today.Date.ToShortDateString() + ">Click here</a>";

renders in the mail as this:

http://localhost:6171/activity/index/?Id=

Where it should be like this:

http://localhost:6171/activity/index/?Id=57&date=16/01/2018

You should append it within the href attribute like:

  "<a href='http://localhost:6171/activity/index/?Id=" + x.EmpId + "&date=" 
+ DateTime.Today.Date.ToShortDateString() + "'>Click Me</a>";

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM