I have the following code in my controller called UserController
:
public ActionResult Details(string name)
{
MyModelDataContext db = new MyModelDataContext();
Product user = db.Products.Single(t => t.Name == name);
return View(user);
}
I expect that when I browse directly to http://localhost:port/User/Details/SomeName
, I will reach this function with the "name
" parameter containing "SomeName". I do get to this function, but "name
" is null. I didn't change any of the default settings of the project.
What am I doing wrong?
Thanks
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With