如何使字符串的HTML链接 [英] how render string to html link

查看:142
本文介绍了如何使字符串的HTML链接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我发送一些消息,如下面电子邮件:

I send some message to email as below:

string link = "http://localhost:1900/ResetPassword/?username=" + user.UserName + "&reset=" + HashResetParams( user.UserName, user.ProviderUserKey.ToString() );
email.Body = link;

这串被送到了电子邮件,但显示为字符串,而不是为纽带,我想将其作为链接点击。

This string was sent to email, but shown as string, not as link, I want send it as link to click.

推荐答案

试试这个

string link = String.Format("<a href=\"http://localhost:1900/ResetPassword/?username={0}&reset={1}\">Click here</a>", user.UserName, HashResetParams( user.UserName, user.ProviderUserKey.ToString() ));

这篇关于如何使字符串的HTML链接的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆