i make a simple application in asp.net mvc 4
i make a random link, and send the random link to email.. and when i click link in email, it will redirect to www.google.com
my problem is, if i click my link at my email, i'm not redirect to www.google.com
how i can solve my problem?
this my code
public ActionResult Index(alamatWeb alamatweb)
{
var encryptText = MyEncryptDecript.Library.lockIt.EnString("a");
var clearText = MyEncryptDecript.Library.lockIt.DeString(encryptText);
ViewBag.encrypt = encryptText;
ViewBag.decrypt = clearText;
PasswordRandom x = new PasswordRandom();
string paswordacak ="http://localhost:4466/User?UserID="+ x.GeneratePassword();
ViewBag.acak = paswordacak;
alamatweb.link = paswordacak;
alamatweb.referensi = "www.rajakamar.com";
url.alamatWebs.Add(alamatweb);
url.SaveChanges();
var c = (from d in url.alamatWebs
select d.link).First();
var aar = new tampilModel {
link = c
};
new MailController().SampleEmail(aar).Deliver();
return View();
}
public ActionResult User()
{
var e = (from a in url.alamatWebs
select a.link).ToList();
var c = (from d in url.alamatWebs
select d.link).First();
if (e.Any(u => u == c))
{
return Redirect("www.google.com");
}
return View();
}
Try this
string link = "http://www.google.com";
return Redirect(link);
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With