I am facing a strange issue, sometimes i am getting the url from the sendgrid as
https://localhost:81/Activation?username=ats8@test.com&activationToken=EAAAAA
which works fine. but sometimes i am getting url which is encoded as follows,
"https://localhost:81/Activation?username=ats8%40test.com&activationToken=EAAAAA"
and my ViewModel is as follows,
public class Verification
{
[DataType(DataType.EmailAddress)]
public string Username { get; set; }
[Required]
[DataType(DataType.Password)]
public string Password { get; set; }
[Required]
[DataType(DataType.Password)]
[Compare("Password")]
public string ConfirmPassword { get; set; }
public string ActivationToken { get; set; }
}
and the Method goes as follows,
public ActionResult Activation(string username, string activationToken)
{
var model = new Verification
{
Username = username,
ActivationToken = activationToken
};
return View(model);
}
on the 2nd case, the activationToken comes as null. how can i detect activationToken even if the url is encoded?