简体   繁体   中英

Syntax to Output Email by Razor in ASP.net

Lets say { string domain="domain.com"; } { string domain="domain.com"; }

I like to output

webmaster@domain.com , so I use

webmaster@@domain not working

Please advice correct syntax

Not the easiest way, maybe, but I would try

@Html.Raw(string.Format("webmaster@{0}", domain))

As (smartly) noticed by OP

@string.Format("webmaster@{0}", domain)

Easiest ways I can think of:

webmaster@@@domain

-or-

@("webmaster@" + domain)

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