I’m getting familiar with MVC 3. I got stuck on the first thing in the tutorial – unbelievable!
This is my Controller-method:
public string Welcome(string name, int numTimes = 1)
{
return HttpUtility.HtmlEncode("Hello " + name + ", NumTimes is: " + numTimes);
}
And the url I’m using:
http://localhost:49770/HelloWorld/Welcome?name=Adam?numTimes=4
Which should produce this:
Hello Adam, NumTimes is: 4
But it actually becomes this:
Hello Adam?numTimes=4, NumTimes is: 1
It does not separate the params! It must be something really simple I’ve missed!
You’ve got 2 question marks (?). change the second one to an ampersand (&)