Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>I also had the same problem once and what I did was use the Ajax call inside the jQuery function. First I selected all parameter values using jQuery selectors. Below is my jQuery function.</p> <pre><code>&lt;script language="javascript" type="text/javascript"&gt; $(document).ready(function () { $('#btnSendNow').click(function () { var grid = $('#Patient-kendo-Grid').data('kendoGrid'); var location = $('#EmailTempalteLocation option:selected').text(); var appoinmentType = $('#EmailTemplateAppoinmentType option:selected').text(); var emailTemplateId = $('#EmailTemplateDropdown').val(); var single = $('input:radio[name=rdbSingle]:checked').val(); var data = grid.dataSource.view(); var dataToSend = { patients: data, place: location, appoinment: appoinmentType, rdbsingle: single, templateId: emailTemplateId }; debugger; $.ajax({ url: 'Controller/Action', type: 'post', dataType: 'json', contentType: 'application/json; charset=utf-8', data: JSON.stringify(dataToSend) }); }); }); &lt;/script&gt; </code></pre> <p>My controller method has five parameters and it is as below.</p> <pre><code>[HttpPost] public ActionResult SendEmailToMany(List&lt;PatientModel&gt; patients, string place, string appoinment, string rdbsingle, string templateId) { emailScheduleModel = new EmailScheduleModel(); AmazonSentEmailResultModel result; List&lt;string&gt; _toEmailAddressList = new List&lt;string&gt;(); List&lt;string&gt; _ccEmailAddressList = new List&lt;string&gt;(); List&lt;string&gt; _bccEmailAddressList = new List&lt;string&gt;(); IEmailTemplateService emailTemplateService = new EmailTemplateService(); EmailTemplateContract template = emailTemplateService.GetEmailTemplateById(new Guid(templateId)); emailScheduleModel.EmailTemplateContract = new EmailTemplateContract(); emailScheduleModel.EmailTemplateContract = template; } </code></pre> <p>It is working fine in my developments.</p> <p>For further details please follow the below url.<br> <a href="http://dushanthamaduranga.blogspot.com/" rel="nofollow">http://dushanthamaduranga.blogspot.com/</a></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload