I'm trying to do an invitation system, and if my solution is looking weird even to myself something gotta be wrong.
A user call an URL for an invitation
site.com/Account/Invitation/invitationGUID
public ActionResult Invitation(Guid invitationGUID)
{
//Check for the existence of the invitation id
if(true)
return RedirectToAction("Account","Register")
return View("InvalidInvite");
}
I need to pass the invitationGUID to the Register action
public ActionResult Register()
{
//this is the registration form
return View();
}
And I still need the invitationGUID at the post, to save this information
[AcceptVerbs(HttpVerbs.Post)]
public ActionResult Register(string email, string password, string confirmPassword,
string firstName, string lastName, string cep)
{
//register user
return View();
}
What should I be doing to pass this information along?
I tried passing the data from Invitation -> Register
return RedirectToAction("Account","Register",invitationGUID)
Calling the Register view with the invitationGUID
return View("Register",invitationGUID);
And Using a hidden input at the Register View to get it back to Register with POST
<%= Html.Hidden("invitationGUID",(Guid)Model %>
It looks too interweaving to my taste, and I'm probably breaking a lot of good practices regarding view/controller isolation.
Should I just be replicating the Register code at Invitation?
I'm tending to just replicating the Register POST action at an Invitation POST right now.
Any idea what I should be doing differently?