我正在开发一个网站在asp.net mvc 2.0 .Here,我想发送的网址链接到用户注册的用户电子邮件。我想发送的网址格式,如果用户点击该链接将把他带到用户模块的索引页,在那里他可以输入他的用户名和密码,并登录到用户模块。
请告诉我怎么做,或者给我这些类型的帖子的链接。
提前谢谢你,
发布于 2010-11-03 16:02:43
您可以使用UrlHelper.Action方法:
public ActionResult Email()
{
// Notice the last parameter which contains the protocol:
// this one is important if you want the helper to generate
// an absolute url. If you don't specify this parameter the
// generated url will be relative
string url = Url.Action("index", "home", null, "http");
// TODO: Send url by email
_repository.SendMail(url);
return View();
}https://stackoverflow.com/questions/4085064
复制相似问题