Sending of url to confirm user registration in asp.net mvc 2.0
I am developing a site in asp.net mvc 2.0 .Here i want to send the url link to the user email on user registr开发者_StackOverflow中文版ation.I want to send the url format in such a way that if user clicks on that link it will take him to the index page of user module where he can enter his user name and password and login to the user module.
Please tell me how to do it or give me the links of these type of posts.
Thanks in advance,
You could use the UrlHelper.Action method:
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();
}
精彩评论