How to implement 5star rating in popup using Model Popup and store the ratings which are given by user

Hello!
I want to implement 5star rating in the popup and store the ratings which are given by the user, 
so how can i implement 5star rating in popup using Model Popup and store the ratings which are given by the user

1 Reply 1 reply marked as answer

KR Keerthana Rajendran Syncfusion Team September 1, 2020 01:55 PM UTC

Hi Ishan, 

Thanks for contacting Syncfusion support.  

You can use helper to render Rating control within EJ Dialog.  To render Dialog as Modal dialog , you can enable the “EnableModal” property. You can set 5 star rating using Value property and get the final rating value with its change event and store it in database based on your scenario.  

Refer to the following code. 

<div class="control"> 
    @{Html.EJ().Dialog("basicDialog").Title("Rate your experience").EnableModal(true).ContentTemplate( 
@<div> 
    @innerContent() 
</div>).Width(350).MinWidth(300).MinHeight(125).IsResponsive(true).Render();} 
</div> 

@helper innerContent() 
    @Html.EJ().Rating("orientRating").Value(5).ClientSideEvents(e=>e.Change("onChange")) 

<script> 
    function onChange(args) { 
        console.log(args.value); 
    } 
</script> 

We have attached a sample for your reference in the following link 


Now Rating will be rendered within Modal Dialog as shown below 

 

Refer to the below links for more details on these controls 

Rating 
Dialog 
Getting Started 
Demo 
API Reference 



Please let us know if you need further assistance.  

Regards, 
Keerthana. 


Marked as answer
Loader.
Up arrow icon