tags:

views:

15

answers:

1

Can someone tell me why I get the null value for activationLink variable in the following code:

public ActionResult Activate(string activationLink)
    {
        if(string.IsNullOrEmpty(activationLinkROWGUID)) return View("ActivateClientError");

        if (linkROWGUID != Guid.Empty)
        {
            return new CServerFacadeFactory().GetServerFacade.ActivateOperator(activationLinkROWGUID) ? View("ActivateClient") : View("ActivateClientError");
        }
        return View("ActivateClientError");
    }

the link which I use is as follows : http://localhost/ActivateClient/Activate/xxxActivationLink

+1  A: 

If you are using the default route, it expects to map the last value in the url to a parameter named id not activationLink. Either change your parameter name to id or change your routing set up to add a route that maps the value onto the correct parameter name. Changing the name of the parameter is, of course, easier.

tvanfosson
Thank you! It helped
niao