❔ Return PartialView with ``for`` attribute
I have a complex <form> in my .cshtml file and I want to simplify it more, now I have this original code, this is inside the <form>
now instead of doing a foreach loop I want to add these <partial/> views with the click of a button, I plan on doing this by making a controller return the partial view and I'll just append it to the parent div via an ajax call using jquery, I have the following action in the controller below
this returns the partial view but how do I add
for="parentAssistance[assistanceIndex].Assistances[assistanceDataIndex]"
in the PartialView? Is this even possible? If not could there be another way around it?5 Replies
I'd just see what that
asp-for
generates and append all the elements needed with JS ¯\_(ツ)_/¯yeah but isnt there a more better way
or maybe we can do this with blazor
If you want to pull a whole-ass Blazor to do that, sure, you can try
mmm...i see, if its tanya saying it then there really must be no other way
Was this issue resolved? If so, run
/close
- otherwise I will mark this as stale and this post will be archived until there is new activity.