Last post Jul 20, 2018 10:48 AM by JoelHJames614
Jul 19, 2018 09:54 PM|JoelHJames614|LINK
I want to be able to pass a string id to a method on the partial razor page. The partial page will then call the Web API which
returns a model object. In the behind code of the partial page I am trying to render a simple input based on the model values I got from the Web API f of the partial page. I want to then render the partial page inside my main page under a specific
div tag id.
Can anyone provide me with a code example?
Jul 20, 2018 12:28 AM|shwetalenka|LINK
Here you go: https://stackoverflow.com/questions/9788654/load-partial-view-in-a-div-mvc
Jul 20, 2018 12:33 AM|JoelHJames614|LINK
Jul 20, 2018 09:28 AM|Xing Zou|LINK
From your description, your partial view is a Razor Page. However a partial view in asp.net core only renders views into html and have no logic actions.
If your views need to execute code, use a view component instead of a partial view, you could refer below link to learn how to use view component:
Jul 20, 2018 10:48 AM|JoelHJames614|LINK
Thank you! I will try that today