Reputation: 3218
I'm still kinda fuzzy on mvc mapping to action methods but here's what I understand:
If the app does a form.submit on, say http://mysite/mycontroller/myaction
, mvc will a) look for a method named myaction on mycontroller that receives a model as a parameter, and b) create an instance of the model and populate the properties whose names match the form fields. and c) call that method passing that model as a parm. Correct so far?
I want to pass an additional parameter on the url, e.g., my url will be
http://mysite/mycontroller/myaction/someparmvalue
and I hoped I could receive that parm by declaring my method as
public ActionResult Export(MyModel m, string someparm)
but that doesn't seem to work. The model instance is created, the method is called, but the someparm value is null. Am I misunderstanding the way this should work?
Upvotes: 2
Views: 677