Hi Megan Pieters,
Greeting from Syncfusion support!
We understand the importance of seamlessly passing data to the OnPost method in your Razor page. To address your specific scenario, we've prepared a sample that aligns with your needs. Please review the provided code snippet below:
|
<div id="container" style="height:400px;">
<ejs-dialog id="dialog" header="Dialog" target="#container" width="250px">
<e-content-template>
<form method="post">
<ejs-multiselect id="games" name="SelectedValues" mode="Box" dataSource="data"></ejs-multiselect>
<div id="errorMessage">
<span asp-validation-for="SelectedValues"></span>
</div>
<div id="submitbutton">
<button id="submitButton" type="submit" content="Submit" class="btn btn-secondary btn-sm">Submit</button>
</div>
</form>
</e-content-template>
</ejs-dialog>
</div>
[HomeController.cs]
[HttpPost]
public void OnPost()
{
SelectedValues =
Request.Form["SelectedValues"]; //Triggers form action
var enteredValue = SelectedValues;
}
|
This code snippet captures the selected values from the multiselect in the OnPost method. Please incorporate this solution into your project, and let us know if it meets your requirements.
Attachment:
RazorPagesSyncfusion_4dcd420f.zip