在我的控制器操作中,我正在向视图发送消息 -
model.Result = ex.Message;
model.Result = model.Result + @" If you would like to create one, please <a href="something"> click here </a>";
所以,我希望消息像这样显示 -
The member doesn't exist. If you would like to create one, please click here.
但实际显示的是
The member doesn't exist. If you would like to create one, please <a href> click here </a>.
所以,我有两个问题——
1) 为什么逐字字符串文字不评估 html。
2)有没有更好的方法来做到这一点?我不喜欢在我的控制器中使用 html,但我也不想为一行 html 过度构建东西。
小唯快跑啊
相关分类