Click here to Skip to main content
15,887,083 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
See more:
ASP.NET
<div class="modal-bod7y">
    @{Html.RenderAction("NewOrder", "Order");}
</div>

This is modal form "NewOrder" i got an error of this using asp.net core mvc
Please help me thank you

What I have tried:

ASP.NET
<div class="modal-bod7y">
    @{Html.RenderAction("NewOrder", "Order");}
</div>
Posted
Updated 4-Jul-23 0:20am
v3
Comments
Sandeep Mewara 1-Jul-23 0:19am    
What error. Your query is not clear. Please share more details.
OriginalGriff 1-Jul-23 0:39am    
This is not a good question - we cannot work out from that little what you are trying to do. We have no idea what error message you get, when you get it, what you did to get the error, or what you have tried in order to fix it - and we can't run one line of code in isolation to find out!

Remember that we can't see your screen, access your HDD, or read your mind - we only get exactly what you type to work with - we get no other context for your project.
Imagine this: you go for a drive in the country, but you have a problem with the car. You call the garage, say "it broke" and turn off your phone. How long will you be waiting before the garage arrives with the right bits and tools to fix the car given they don't know what make or model it is, who you are, what happened when it all went wrong, or even where you are?

That's what you've done here. So stop typing as little as possible and try explaining things to people who have no way to access your project!

Use the "Improve question" widget to edit your question and provide better information.
Graeme_Grant 1-Jul-23 0:42am    
Yep, what error? Code is missing too.

1 solution

In ASP.NET Core MVC, the 'RenderAction' method is not available by default. You can use similar functionalities using 'PartialViewResult' and Partial or 'ViewComponent', examples given at - RenderPartial vs RenderAction vs Partial vs Action in MVC[^]

If you only want to use partial view within the current view -
ASP.NET
@await Html.PartialAsync("NewOrder", "Order")


Alternatively, if you want to use a view component, you can create a view component and then call it in your view -
ASP.NET
@await Component.InvokeAsync("NewOrder", new { /* optional parameters */ })
 
Share this answer
 
v2
Comments
ROPU_05051971 5-Jul-23 23:58pm    
Thank you so much
Andre Oosthuizen 6-Jul-23 2:39am    
You're welcome

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900