I have a file uploader inside a partial view. If I add more than one partial view on a razor page, only the uploader in the 1st partial view renders, the rest don't. How can I get multiple partial view instances to correctly render ejs controls.
Full Project is attached
You can follow the Syncfusion blog shared below regarding your requirement.
You have shared a the introductory explanation of how to use partial views. I know how to use partial views and my problem is specifically when using a partial view twice on the page.
The example in your link uses the partial view only once . When I change the code in your example to display partial view twice, I see the exact same error.
Also I am using Razor Pages while both these examples are for MVC.
Anyway my problem irrespective of whether its MVC or Razor pages, is only when I use the partial view twice in my Razor Page.
To resolve this issue, you can try using unique IDs for each file uploader instance inside the partial views. By default, the IDs of the ejs controls generated in partial views will be the same across all instances, which can cause conflicts and issues with rendering.
For example, you can use the following code to generate a unique ID for each file uploader:
string uploaderId = "uploader_" + DateTime.Now.Ticks.ToString();
<div class="rounded bg-light pt-3 pb-3">
<label for="txtSomeThing">Enter something here: </label>
<input type="text" id="txtSomeThing" />