Hi,
I am using MVC 2.
I have 2 controllers called Application and Note. The application is a loan application. A note can be added to an application.
On my Index I have a grid that displays all the applications, and an action column with a link that says "Add Note".
In my Application controller I have action methods for create and edit. In my Note controller I have action methods for create, edit and delete.
I was wondering if the following is possible when the user clicks on the "Add Note" link to go to a URL like:
Application/1/Note/Create
1 is the application ID. Note would be the Note controller, and Create is the action method in the Note controller. Is something like this possible?
I started with the mapping in my global.asax, but not sure if it is correct:
routes.MapRoute(
null,
"Application/{ApplicationID}/{controller}/{action}",
new { controller = "Note", action = "Create" });
How would I create the link in my grid using the action link?
Please could someone advise?
EDIT:
The grid above is on my Index view in my Home direcotry. So on this grid I need to concatenate the link to display as above. I'm struggling to create this link on my Index view. It's not concatenating correctly. Currently I have this:
Html.ActionLink("Add Note", "Create", "Note", new { ApplicationID = c.ApplicationID }, null)
And it is displaying as /Note/Create/?ApplicationID=1
I need it to display as:
/Application/1/Note/Create
Thanks Brendan