Change partial view with a link button from another partial view
Anyone who knows how to change a single partial view in a page with a link from the same page, inside another form? In this example, I want to change partial view from CreateHikingDestination to UpdateHikingDestination, but the link is on the inside of another partial view: ListHikingDestinations.
For example, if I use this from the Endre button (same as update) inside partial view ListHikingDestinations:
The code find the right form with the id, but it's only shows this partial view, not the entire page (no surprise, realy).
The obvious option is to create a new page of course, but I think switching partial views may be useful sometimes - like now when I want to keep all information about hiking destinations on the same pagename.
I think there is a easy way to redirect to the same page, same surfacecontroller, and use another Action with Id (named ReadHikingDestinationById (int Id)) - from the update and delete buttons, maybe with @Html.ActionLink, but how?
Change partial view with a link button from another partial view
Anyone who knows how to change a single partial view in a page with a link from the same page, inside another form? In this example, I want to change partial view from CreateHikingDestination to UpdateHikingDestination, but the link is on the inside of another partial view: ListHikingDestinations.
For example, if I use this from the Endre button (same as update) inside partial view ListHikingDestinations:
It fetches the right action named ReadHikingDestinationById(id) from the HikingDestinationSurfaceController
The code find the right form with the id, but it's only shows this partial view, not the entire page (no surprise, realy).
The obvious option is to create a new page of course, but I think switching partial views may be useful sometimes - like now when I want to keep all information about hiking destinations on the same pagename.
I think there is a easy way to redirect to the same page, same surfacecontroller, and use another Action with Id (named ReadHikingDestinationById (int Id)) - from the update and delete buttons, maybe with
@Html.ActionLink
, but how?So, how do we normally swap one of several partial views (all via macros), on the same page (from a textlink from another partial view)?
This together with an id value to retrieve a single record from a database into the new update partial view for editing.
is working on a reply...