Hello all,
In my view "EditUser" I have an action link which i click not always:
<%= Html.ActionLink("Resend forgotten password", "EditUser", this.Model.UserName, null)%><br />
In my controller "AdministrationController" i have an EditUser ActionResult there i would like to call Method which send forgotten password. But I dont know how to react if i clicked an action link or not. I dont want to send Password each time when I call Action "EditUser".
My Action in AdministratorController:
[HttpPost]
[ValidateInput(false)]
public ActionResult EditUser(EditUserModel model)
{
try
{
Admin admin = new Admin();
admin.SendForgottenPasswordToUser(model.UserName);
if (!model.Validate())
{
ModelState.AddModelError("", "Please fill missed fields");
}
if (!model.Save())
{
ModelState.AddModelError("", "Error while saving data");
}
else
{
ModelState.AddModelError("", "Successufully edited.");
}
return View(model);
}