问题
Is it possible to include hyperlink as a part of text in app.config key value pair (email body text as value)? I want to generate email body from app.config key value.
For example:
<add key="EmailBody" value="Email body goes here with <a href="some link">click here</a> hyperlink/>
I know this is not valid, but is there a way to achieve this?
Thanks in advance!
回答1:
The way i would do it is write your email body as shown but do not actually add the etc. Instead, do something like the following :
<add key="EmailBody" value="Email body goes here with &&&www.google.com!!!click here£££>
Then, on the code side that is accessing / handling this key, replace &&& with :
<a href="
replace !!! with :
">
replace £££ with :
</a>
This is just an example, but gives you a little idea on how to get around the fact you cant have tags in attributes.
Hope this helps.
来源:https://stackoverflow.com/questions/16196680/is-it-possible-to-include-hyperlink-in-app-config-key-value