jquery - Get value from bootstrap modal, save, refresh page -


i have bootstrap modal window on mvc razor page. i'm trying create modal textbox, save , cancel button, , if value saved, i'd refresh page after happens.

the strategy attempting use javascript send needed fields mvc controller, , in turn send them c# function save, , after that, refresh page. set break point in google chrome, , know i'm @ least calling javascript function, there going wrong.

on razor page have modal

<div class="col-lg-6">                         <div id="adjustedamountmodal" class="modal fade" role="dialog">                             <div class="modal-dialog">                                 <div class="modal-content">                                     <div class="modal-header">                                         <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</button>                                         <h4 class="modal-title">new adusted liability amount:</h4>                                         @html.textboxfor(model => model.adjustedliabilityamount)                                     </div>                                     <div class="modal-footer" style="text-align:center">                                         <div>                                             <button id="saveadjustedamount" type="button" class="btn btn-primary view-insp">save</button>                                             <button id="button_closemodal" type="button" class="btn btn-default close-modal" data-dismiss="modal">cancel</button>                                         </div>                                     </div>                                 </div>                             </div>                         </div>                     </div> 

my javascript function (which @ least being called), follows

$(document).on("click", "#saveadjustedamount", function () {  $.ajax({     cache: false,     type: "post",     datatype: "json",     data: { "pdot": $("#dotnumber").val(), "pkyu": $("#kyunumber").val(), "pkit": $("#kitnumber").val(), "pcarriername": $("#carriername").val(), "pamount": $("#liabilityamount").val(), "padjustedliabilityamount": $("#adjustedliabilityamount").val() },     url: resolveurl('~/jeopardyassessmentcontroller/savevalue'),     success: function (redirecturl) {         //simply redirect refresh page         window.location.href = redirecturl;     } }); 

});

in chrome developer tools, i'm seeing red squiggly underneath line

url: resolveurl('~/jeopardyassessmentcontroller/savevalue'), 

uncaught referenceerror: resolveurl not defined

i have break in visual studio in controller function i'm attempting call

[httppost]     public actionresult savevalue(string pdot, string pkyu, string pkit, string pcarriername, decimal pamount, string padjustedliabilityamount)     {         obs_lib.bll.jeopardyassessment.jeopardyassessment.savejeopardyassessment(pdot, pkyu, pkit, pcarriername, pamount, user.identity.name, padjustedliabilityamount);         return json(url.action("create", "jeapordyassessment"));     } 

this 1 not being called, , i'm beginning question entire strategy here. going remotely correctly? possible achieve i'm attempting, , if so, how?

i'm little new this, , appreciated.

return json(url.action("create", "jeapordyassessment")); 

not sure if related supposed jeapordyassessment , not jeopardyassessment?


Comments