Error: jquery.min.js return 500 internal server errorevent.preventDefault() vs. return falseWhat's the difference between jquery.js and jquery.min.js?Ajax request returns 200 OK, but an error event is fired instead of successWhy does ++[[]][+[]]+[+[]] return the string “10”?How do I return the response from an asynchronous call?Why does my JavaScript code get a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error when Postman does not?How to filter DropDown list by logged in User in MVCJquery to set all controls in a div to readonly - telerik controls arent readonlyinternal server error 500 with jquery.min.jsasp.net mvc 4 dropdown list with model isn't working
Why do some professors with PhDs leave their professorships to teach high school?
Animation advice please
Hand soldering SMD 1206 components
Using “sparkling” as a diminutive of “spark” in a poem
Why is the voltage measurement of this circuit different when the switch is on?
Are there any efficient algorithms to solve the longest path problem in networks with cycles?
How to perform Login Authentication at the client-side?
Is there a way to scan someone's memories while they sleep without them knowing?
Is there a maximum distance from a planet that a moon can orbit?
Do flight schools typically have dress codes or expectations?
Why doesn't a marching band have strings?
What are familiars really?
What happens when I sacrifice a creature when my Teysa Karlov is on the battlefield?
What is the legal status of travelling with (unprescribed) methadone in your carry-on?
Does squid ink pasta bleed?
First-year PhD giving a talk among well-established researchers in the field
What are the penalties for overstaying in USA?
How does a blind passenger not die, if driver becomes unconscious
Fedora boot screen shows both Fedora logo and Lenovo logo. Why and How?
Links to webpages in books
Changing the opacity of lines on a plot based on their value
Are Finite Automata Turing Complete?
How to add multiple ip address in destination ip in acl rule
What reason would an alien civilization have for building a Dyson Sphere (or Swarm) if cheap Nuclear fusion is available?
Error: jquery.min.js return 500 internal server error
event.preventDefault() vs. return falseWhat's the difference between jquery.js and jquery.min.js?Ajax request returns 200 OK, but an error event is fired instead of successWhy does ++[[]][+[]]+[+[]] return the string “10”?How do I return the response from an asynchronous call?Why does my JavaScript code get a “No 'Access-Control-Allow-Origin' header is present on the requested resource” error when Postman does not?How to filter DropDown list by logged in User in MVCJquery to set all controls in a div to readonly - telerik controls arent readonlyinternal server error 500 with jquery.min.jsasp.net mvc 4 dropdown list with model isn't working
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I create a web application in asp.net MVC 4 with entity framework 6.0.
in which I create detail(list) of data. on the top of the list give one button to add some data. On click of the edit button, the form will open in a bootstrap modal popup. it is working fine. In detail page, every row has edited and delete button from that user can delete the record.
Now on click of an edit button popup will open with data..but now this does not work well.it gives me an error of 500 Internal server error in the jquery.min.js file.
here I put some code snippet for better understanding.
This is my CurrencyDetail page
@model IEnumerable<RedICMVC.Models.Currency>
@
ViewBag.Title = "CurrencyDetail";
Layout = "~/Views/Shared/_Layout.cshtml";
<div class="card">
<div class="card-header card-header-primary card-header-icon">
<div class="card-icon">
<i class="material-icons">assignment</i>
</div>
<h4 class="card-title">Currency Details</h4>
<p style="float:right">
<a class="btn btn-primary" onclick="AddEdit()">
<i class="material-icons">add</i>Add Currency
</a>
</p>
</div>
<div class="card-body">
<div class="material-datatables">
<table id="datatables" class="table table-striped table-bordered dt-responsive table-hover text-center" cellspacing="0" width="100%" style="width:100%">
<thead>
<tr>
<th></th>
<th>
@Html.DisplayNameFor(model => model.SR)
</th>
<th>
@Html.DisplayNameFor(model => model.Currency1)
</th>
<th>
@Html.DisplayNameFor(model => model.Cur_Name)
</th>
<th>
@Html.DisplayNameFor(model => model.MainCurrency)
</th>
<th>
@Html.DisplayNameFor(model => model.CoinCurrency)
</th>
<th>
@Html.DisplayNameFor(model => model.ExRate)
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
<a href="#" data-toggle="modal" data-id="@item.SR" data-target="#confirmDelete" data-title="Delete Currency" data-message="Are you sure you want to delete this currency ?">
<i class="material-icons icon_size">delete</i>
</a>
</td>
<td>
@Html.DisplayFor(modelItem => item.SR)
</td>
<td>
@Html.DisplayFor(modelItem => item.Currency1)
</td>
<td>
@Html.DisplayFor(modelItem => item.Cur_Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.MainCurrency)
</td>
<td>
@Html.DisplayFor(modelItem => item.CoinCurrency)
</td>
<td>
@Html.DisplayFor(modelItem => item.ExRate)
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@Html.Partial("DialogBox", "Home")
<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="model1" class="modal fade">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
@*<h4 class="modal-title">Add Unit</h4>*@
</div>
<div class="modal-body" id="modelBody">
</div>
</div>
</div>
</div>
@section scripts
<script>
var AddEdit = function (SR)
var url = "/Currency/AddCurrency?id=" + SR;
$("#modelBody").load(url, function ()
$("#model1").modal("show");
)
$('.commanId').click(function ()
debugger;
var id = $(this).val();
$.get("/Currency/GetRecordFromId?id=" + id, function (data, status)
debugger;
var url = "/Currency/GetRecordFromId?id=" + id;
$("#modelBody").load(url, function ()
$("#model1").modal("show");
)
);
);
</script>
This is my AddCurrency Page
@model RedICMVC.Models.SpCurrency
@
ViewBag.Title = "AddCurrency";
Layout = null;
<!DOCTYPE html>
<div class="card">
<div class="card-header card-header-rose card-header-icon">
<div class="card-icon">
<i class="material-icons">details</i>
</div>
<h4 class="card-title">Add Currency</h4>
</div>
<div class="card-body">
@using (Html.BeginForm("AddCurrency", "Currency", FormMethod.Post, new enctype = "multipart/form-data" ))
@Html.AntiForgeryToken()
@Html.ValidationSummary(true, "", new @class = "text-danger" )
<div class="row justify-content-center">
<div class="col-lg-10">
<div class="form-group require">
@Html.EditorFor(model => model.Currency, new htmlAttributes = new @class = "form-control", @placeholder = "Currency" )
@Html.ValidationMessageFor(model => model.Currency, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.Cur_Name, new htmlAttributes = new @class = "form-control", @placeholder = "Currency Name" )
@Html.ValidationMessageFor(model => model.Cur_Name, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.MainCurrency, new htmlAttributes = new @class = "form-control", @placeholder = "Main Currency" )
@Html.ValidationMessageFor(model => model.MainCurrency, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.CoinCurrency, new htmlAttributes = new @class = "form-control", @placeholder = "Coin Currency" )
@Html.ValidationMessageFor(model => model.CoinCurrency, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.ExRate, new htmlAttributes = new @class = "form-control", @placeholder = "Excext Rate" )
@Html.ValidationMessageFor(model => model.ExRate, "", new @class = "text-danger" )
</div>
</div>
<div class="card-footer">
<div class="card-footer">
<input type="submit" class="btn btn-finish btn-fill btn-rose btn-wd" name="Save" value="Save">
<input type="reset" class="btn btn-finish btn-fill btn-danger btn-wd" name="reset" value="Reset">
</div>
</div>
</div>
</div>
</div>
@section Scripts
@Scripts.Render("~/bundles/jqueryval")
Here is My controller
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using RedICMVC.Models;
using RedICMVC.Common.Toaster;
using System.Data.SqlClient;
namespace RedICMVC.Controllers.Masters
public class CurrencyController : Controller
protected RedICMVCDBEntities Db = new RedICMVCDBEntities();
// GET: Currency
public ActionResult CurrencyDetail()
var sprecult = Db.Currencies.ToList();
return View(sprecult);
public ActionResult AddCurrency()
return View();
[HttpPost]
public ActionResult AddCurrency(SpCurrency cr)
if (cr.SR == 0)
var spresult = Db.Sp_Currency_Insert(cr.Currency, cr.Cur_Name, cr.MainCurrency, cr.CoinCurrency, cr.ExRate);
if (spresult == 1
else
var spresult = Db.Sp_Currency_Update(cr.SR, cr.Currency, cr.Cur_Name, cr.MainCurrency, cr.CoinCurrency, cr.Symbol, cr.ExRate);
if(spresult==1
return View();
[HttpGet]
public ActionResult GetRecordFromId(int id)
var idParam = new SqlParameter
ParameterName = "SR",
Value = id
;
var courseList = Db.Database.SqlQuery<SpCurrency>("exec sp_Currency_Get @SR", idParam).FirstOrDefault<SpCurrency>();
return View("AddCurrency", courseList);
public ActionResult DeleteConfirmed(int id)
var spresult = Db.sp_Currency_Delete(id);
if (spresult == 1
this is an image of output with both (Error and What I want in output)
Output image
Please, Can anyone give me a solution.?
Thank You in advance.
javascript jquery asp.net-mvc-4 bootstrap-modal
add a comment |
I create a web application in asp.net MVC 4 with entity framework 6.0.
in which I create detail(list) of data. on the top of the list give one button to add some data. On click of the edit button, the form will open in a bootstrap modal popup. it is working fine. In detail page, every row has edited and delete button from that user can delete the record.
Now on click of an edit button popup will open with data..but now this does not work well.it gives me an error of 500 Internal server error in the jquery.min.js file.
here I put some code snippet for better understanding.
This is my CurrencyDetail page
@model IEnumerable<RedICMVC.Models.Currency>
@
ViewBag.Title = "CurrencyDetail";
Layout = "~/Views/Shared/_Layout.cshtml";
<div class="card">
<div class="card-header card-header-primary card-header-icon">
<div class="card-icon">
<i class="material-icons">assignment</i>
</div>
<h4 class="card-title">Currency Details</h4>
<p style="float:right">
<a class="btn btn-primary" onclick="AddEdit()">
<i class="material-icons">add</i>Add Currency
</a>
</p>
</div>
<div class="card-body">
<div class="material-datatables">
<table id="datatables" class="table table-striped table-bordered dt-responsive table-hover text-center" cellspacing="0" width="100%" style="width:100%">
<thead>
<tr>
<th></th>
<th>
@Html.DisplayNameFor(model => model.SR)
</th>
<th>
@Html.DisplayNameFor(model => model.Currency1)
</th>
<th>
@Html.DisplayNameFor(model => model.Cur_Name)
</th>
<th>
@Html.DisplayNameFor(model => model.MainCurrency)
</th>
<th>
@Html.DisplayNameFor(model => model.CoinCurrency)
</th>
<th>
@Html.DisplayNameFor(model => model.ExRate)
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
<a href="#" data-toggle="modal" data-id="@item.SR" data-target="#confirmDelete" data-title="Delete Currency" data-message="Are you sure you want to delete this currency ?">
<i class="material-icons icon_size">delete</i>
</a>
</td>
<td>
@Html.DisplayFor(modelItem => item.SR)
</td>
<td>
@Html.DisplayFor(modelItem => item.Currency1)
</td>
<td>
@Html.DisplayFor(modelItem => item.Cur_Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.MainCurrency)
</td>
<td>
@Html.DisplayFor(modelItem => item.CoinCurrency)
</td>
<td>
@Html.DisplayFor(modelItem => item.ExRate)
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@Html.Partial("DialogBox", "Home")
<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="model1" class="modal fade">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
@*<h4 class="modal-title">Add Unit</h4>*@
</div>
<div class="modal-body" id="modelBody">
</div>
</div>
</div>
</div>
@section scripts
<script>
var AddEdit = function (SR)
var url = "/Currency/AddCurrency?id=" + SR;
$("#modelBody").load(url, function ()
$("#model1").modal("show");
)
$('.commanId').click(function ()
debugger;
var id = $(this).val();
$.get("/Currency/GetRecordFromId?id=" + id, function (data, status)
debugger;
var url = "/Currency/GetRecordFromId?id=" + id;
$("#modelBody").load(url, function ()
$("#model1").modal("show");
)
);
);
</script>
This is my AddCurrency Page
@model RedICMVC.Models.SpCurrency
@
ViewBag.Title = "AddCurrency";
Layout = null;
<!DOCTYPE html>
<div class="card">
<div class="card-header card-header-rose card-header-icon">
<div class="card-icon">
<i class="material-icons">details</i>
</div>
<h4 class="card-title">Add Currency</h4>
</div>
<div class="card-body">
@using (Html.BeginForm("AddCurrency", "Currency", FormMethod.Post, new enctype = "multipart/form-data" ))
@Html.AntiForgeryToken()
@Html.ValidationSummary(true, "", new @class = "text-danger" )
<div class="row justify-content-center">
<div class="col-lg-10">
<div class="form-group require">
@Html.EditorFor(model => model.Currency, new htmlAttributes = new @class = "form-control", @placeholder = "Currency" )
@Html.ValidationMessageFor(model => model.Currency, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.Cur_Name, new htmlAttributes = new @class = "form-control", @placeholder = "Currency Name" )
@Html.ValidationMessageFor(model => model.Cur_Name, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.MainCurrency, new htmlAttributes = new @class = "form-control", @placeholder = "Main Currency" )
@Html.ValidationMessageFor(model => model.MainCurrency, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.CoinCurrency, new htmlAttributes = new @class = "form-control", @placeholder = "Coin Currency" )
@Html.ValidationMessageFor(model => model.CoinCurrency, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.ExRate, new htmlAttributes = new @class = "form-control", @placeholder = "Excext Rate" )
@Html.ValidationMessageFor(model => model.ExRate, "", new @class = "text-danger" )
</div>
</div>
<div class="card-footer">
<div class="card-footer">
<input type="submit" class="btn btn-finish btn-fill btn-rose btn-wd" name="Save" value="Save">
<input type="reset" class="btn btn-finish btn-fill btn-danger btn-wd" name="reset" value="Reset">
</div>
</div>
</div>
</div>
</div>
@section Scripts
@Scripts.Render("~/bundles/jqueryval")
Here is My controller
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using RedICMVC.Models;
using RedICMVC.Common.Toaster;
using System.Data.SqlClient;
namespace RedICMVC.Controllers.Masters
public class CurrencyController : Controller
protected RedICMVCDBEntities Db = new RedICMVCDBEntities();
// GET: Currency
public ActionResult CurrencyDetail()
var sprecult = Db.Currencies.ToList();
return View(sprecult);
public ActionResult AddCurrency()
return View();
[HttpPost]
public ActionResult AddCurrency(SpCurrency cr)
if (cr.SR == 0)
var spresult = Db.Sp_Currency_Insert(cr.Currency, cr.Cur_Name, cr.MainCurrency, cr.CoinCurrency, cr.ExRate);
if (spresult == 1
else
var spresult = Db.Sp_Currency_Update(cr.SR, cr.Currency, cr.Cur_Name, cr.MainCurrency, cr.CoinCurrency, cr.Symbol, cr.ExRate);
if(spresult==1
return View();
[HttpGet]
public ActionResult GetRecordFromId(int id)
var idParam = new SqlParameter
ParameterName = "SR",
Value = id
;
var courseList = Db.Database.SqlQuery<SpCurrency>("exec sp_Currency_Get @SR", idParam).FirstOrDefault<SpCurrency>();
return View("AddCurrency", courseList);
public ActionResult DeleteConfirmed(int id)
var spresult = Db.sp_Currency_Delete(id);
if (spresult == 1
this is an image of output with both (Error and What I want in output)
Output image
Please, Can anyone give me a solution.?
Thank You in advance.
javascript jquery asp.net-mvc-4 bootstrap-modal
The 500 error is coming from the server side logic you call from$.get("/Currency/GetRecordFromId?id=" + id, ...I'd suggest checking the response text of the error to see the full stack trace and then stepping through the MVC logic to see where the exact issue is, as the JS itself is fine.
– Rory McCrossan
Mar 25 at 10:20
Response Text is blank in the browser...I trace many times but fail to catch an error..:(
– Company Company
Mar 25 at 10:33
In which case set a breakpoint and step through the C# code when you make a request
– Rory McCrossan
Mar 25 at 10:34
when Get request call I put a debugger and it will work...but after calling in the bracket I put debugger ...at that point response not come.that debugger not work
– Company Company
Mar 25 at 10:42
add a comment |
I create a web application in asp.net MVC 4 with entity framework 6.0.
in which I create detail(list) of data. on the top of the list give one button to add some data. On click of the edit button, the form will open in a bootstrap modal popup. it is working fine. In detail page, every row has edited and delete button from that user can delete the record.
Now on click of an edit button popup will open with data..but now this does not work well.it gives me an error of 500 Internal server error in the jquery.min.js file.
here I put some code snippet for better understanding.
This is my CurrencyDetail page
@model IEnumerable<RedICMVC.Models.Currency>
@
ViewBag.Title = "CurrencyDetail";
Layout = "~/Views/Shared/_Layout.cshtml";
<div class="card">
<div class="card-header card-header-primary card-header-icon">
<div class="card-icon">
<i class="material-icons">assignment</i>
</div>
<h4 class="card-title">Currency Details</h4>
<p style="float:right">
<a class="btn btn-primary" onclick="AddEdit()">
<i class="material-icons">add</i>Add Currency
</a>
</p>
</div>
<div class="card-body">
<div class="material-datatables">
<table id="datatables" class="table table-striped table-bordered dt-responsive table-hover text-center" cellspacing="0" width="100%" style="width:100%">
<thead>
<tr>
<th></th>
<th>
@Html.DisplayNameFor(model => model.SR)
</th>
<th>
@Html.DisplayNameFor(model => model.Currency1)
</th>
<th>
@Html.DisplayNameFor(model => model.Cur_Name)
</th>
<th>
@Html.DisplayNameFor(model => model.MainCurrency)
</th>
<th>
@Html.DisplayNameFor(model => model.CoinCurrency)
</th>
<th>
@Html.DisplayNameFor(model => model.ExRate)
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
<a href="#" data-toggle="modal" data-id="@item.SR" data-target="#confirmDelete" data-title="Delete Currency" data-message="Are you sure you want to delete this currency ?">
<i class="material-icons icon_size">delete</i>
</a>
</td>
<td>
@Html.DisplayFor(modelItem => item.SR)
</td>
<td>
@Html.DisplayFor(modelItem => item.Currency1)
</td>
<td>
@Html.DisplayFor(modelItem => item.Cur_Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.MainCurrency)
</td>
<td>
@Html.DisplayFor(modelItem => item.CoinCurrency)
</td>
<td>
@Html.DisplayFor(modelItem => item.ExRate)
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@Html.Partial("DialogBox", "Home")
<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="model1" class="modal fade">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
@*<h4 class="modal-title">Add Unit</h4>*@
</div>
<div class="modal-body" id="modelBody">
</div>
</div>
</div>
</div>
@section scripts
<script>
var AddEdit = function (SR)
var url = "/Currency/AddCurrency?id=" + SR;
$("#modelBody").load(url, function ()
$("#model1").modal("show");
)
$('.commanId').click(function ()
debugger;
var id = $(this).val();
$.get("/Currency/GetRecordFromId?id=" + id, function (data, status)
debugger;
var url = "/Currency/GetRecordFromId?id=" + id;
$("#modelBody").load(url, function ()
$("#model1").modal("show");
)
);
);
</script>
This is my AddCurrency Page
@model RedICMVC.Models.SpCurrency
@
ViewBag.Title = "AddCurrency";
Layout = null;
<!DOCTYPE html>
<div class="card">
<div class="card-header card-header-rose card-header-icon">
<div class="card-icon">
<i class="material-icons">details</i>
</div>
<h4 class="card-title">Add Currency</h4>
</div>
<div class="card-body">
@using (Html.BeginForm("AddCurrency", "Currency", FormMethod.Post, new enctype = "multipart/form-data" ))
@Html.AntiForgeryToken()
@Html.ValidationSummary(true, "", new @class = "text-danger" )
<div class="row justify-content-center">
<div class="col-lg-10">
<div class="form-group require">
@Html.EditorFor(model => model.Currency, new htmlAttributes = new @class = "form-control", @placeholder = "Currency" )
@Html.ValidationMessageFor(model => model.Currency, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.Cur_Name, new htmlAttributes = new @class = "form-control", @placeholder = "Currency Name" )
@Html.ValidationMessageFor(model => model.Cur_Name, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.MainCurrency, new htmlAttributes = new @class = "form-control", @placeholder = "Main Currency" )
@Html.ValidationMessageFor(model => model.MainCurrency, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.CoinCurrency, new htmlAttributes = new @class = "form-control", @placeholder = "Coin Currency" )
@Html.ValidationMessageFor(model => model.CoinCurrency, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.ExRate, new htmlAttributes = new @class = "form-control", @placeholder = "Excext Rate" )
@Html.ValidationMessageFor(model => model.ExRate, "", new @class = "text-danger" )
</div>
</div>
<div class="card-footer">
<div class="card-footer">
<input type="submit" class="btn btn-finish btn-fill btn-rose btn-wd" name="Save" value="Save">
<input type="reset" class="btn btn-finish btn-fill btn-danger btn-wd" name="reset" value="Reset">
</div>
</div>
</div>
</div>
</div>
@section Scripts
@Scripts.Render("~/bundles/jqueryval")
Here is My controller
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using RedICMVC.Models;
using RedICMVC.Common.Toaster;
using System.Data.SqlClient;
namespace RedICMVC.Controllers.Masters
public class CurrencyController : Controller
protected RedICMVCDBEntities Db = new RedICMVCDBEntities();
// GET: Currency
public ActionResult CurrencyDetail()
var sprecult = Db.Currencies.ToList();
return View(sprecult);
public ActionResult AddCurrency()
return View();
[HttpPost]
public ActionResult AddCurrency(SpCurrency cr)
if (cr.SR == 0)
var spresult = Db.Sp_Currency_Insert(cr.Currency, cr.Cur_Name, cr.MainCurrency, cr.CoinCurrency, cr.ExRate);
if (spresult == 1
else
var spresult = Db.Sp_Currency_Update(cr.SR, cr.Currency, cr.Cur_Name, cr.MainCurrency, cr.CoinCurrency, cr.Symbol, cr.ExRate);
if(spresult==1
return View();
[HttpGet]
public ActionResult GetRecordFromId(int id)
var idParam = new SqlParameter
ParameterName = "SR",
Value = id
;
var courseList = Db.Database.SqlQuery<SpCurrency>("exec sp_Currency_Get @SR", idParam).FirstOrDefault<SpCurrency>();
return View("AddCurrency", courseList);
public ActionResult DeleteConfirmed(int id)
var spresult = Db.sp_Currency_Delete(id);
if (spresult == 1
this is an image of output with both (Error and What I want in output)
Output image
Please, Can anyone give me a solution.?
Thank You in advance.
javascript jquery asp.net-mvc-4 bootstrap-modal
I create a web application in asp.net MVC 4 with entity framework 6.0.
in which I create detail(list) of data. on the top of the list give one button to add some data. On click of the edit button, the form will open in a bootstrap modal popup. it is working fine. In detail page, every row has edited and delete button from that user can delete the record.
Now on click of an edit button popup will open with data..but now this does not work well.it gives me an error of 500 Internal server error in the jquery.min.js file.
here I put some code snippet for better understanding.
This is my CurrencyDetail page
@model IEnumerable<RedICMVC.Models.Currency>
@
ViewBag.Title = "CurrencyDetail";
Layout = "~/Views/Shared/_Layout.cshtml";
<div class="card">
<div class="card-header card-header-primary card-header-icon">
<div class="card-icon">
<i class="material-icons">assignment</i>
</div>
<h4 class="card-title">Currency Details</h4>
<p style="float:right">
<a class="btn btn-primary" onclick="AddEdit()">
<i class="material-icons">add</i>Add Currency
</a>
</p>
</div>
<div class="card-body">
<div class="material-datatables">
<table id="datatables" class="table table-striped table-bordered dt-responsive table-hover text-center" cellspacing="0" width="100%" style="width:100%">
<thead>
<tr>
<th></th>
<th>
@Html.DisplayNameFor(model => model.SR)
</th>
<th>
@Html.DisplayNameFor(model => model.Currency1)
</th>
<th>
@Html.DisplayNameFor(model => model.Cur_Name)
</th>
<th>
@Html.DisplayNameFor(model => model.MainCurrency)
</th>
<th>
@Html.DisplayNameFor(model => model.CoinCurrency)
</th>
<th>
@Html.DisplayNameFor(model => model.ExRate)
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
<a href="#" data-toggle="modal" data-id="@item.SR" data-target="#confirmDelete" data-title="Delete Currency" data-message="Are you sure you want to delete this currency ?">
<i class="material-icons icon_size">delete</i>
</a>
</td>
<td>
@Html.DisplayFor(modelItem => item.SR)
</td>
<td>
@Html.DisplayFor(modelItem => item.Currency1)
</td>
<td>
@Html.DisplayFor(modelItem => item.Cur_Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.MainCurrency)
</td>
<td>
@Html.DisplayFor(modelItem => item.CoinCurrency)
</td>
<td>
@Html.DisplayFor(modelItem => item.ExRate)
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@Html.Partial("DialogBox", "Home")
<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="model1" class="modal fade">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
@*<h4 class="modal-title">Add Unit</h4>*@
</div>
<div class="modal-body" id="modelBody">
</div>
</div>
</div>
</div>
@section scripts
<script>
var AddEdit = function (SR)
var url = "/Currency/AddCurrency?id=" + SR;
$("#modelBody").load(url, function ()
$("#model1").modal("show");
)
$('.commanId').click(function ()
debugger;
var id = $(this).val();
$.get("/Currency/GetRecordFromId?id=" + id, function (data, status)
debugger;
var url = "/Currency/GetRecordFromId?id=" + id;
$("#modelBody").load(url, function ()
$("#model1").modal("show");
)
);
);
</script>
This is my AddCurrency Page
@model RedICMVC.Models.SpCurrency
@
ViewBag.Title = "AddCurrency";
Layout = null;
<!DOCTYPE html>
<div class="card">
<div class="card-header card-header-rose card-header-icon">
<div class="card-icon">
<i class="material-icons">details</i>
</div>
<h4 class="card-title">Add Currency</h4>
</div>
<div class="card-body">
@using (Html.BeginForm("AddCurrency", "Currency", FormMethod.Post, new enctype = "multipart/form-data" ))
@Html.AntiForgeryToken()
@Html.ValidationSummary(true, "", new @class = "text-danger" )
<div class="row justify-content-center">
<div class="col-lg-10">
<div class="form-group require">
@Html.EditorFor(model => model.Currency, new htmlAttributes = new @class = "form-control", @placeholder = "Currency" )
@Html.ValidationMessageFor(model => model.Currency, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.Cur_Name, new htmlAttributes = new @class = "form-control", @placeholder = "Currency Name" )
@Html.ValidationMessageFor(model => model.Cur_Name, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.MainCurrency, new htmlAttributes = new @class = "form-control", @placeholder = "Main Currency" )
@Html.ValidationMessageFor(model => model.MainCurrency, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.CoinCurrency, new htmlAttributes = new @class = "form-control", @placeholder = "Coin Currency" )
@Html.ValidationMessageFor(model => model.CoinCurrency, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.ExRate, new htmlAttributes = new @class = "form-control", @placeholder = "Excext Rate" )
@Html.ValidationMessageFor(model => model.ExRate, "", new @class = "text-danger" )
</div>
</div>
<div class="card-footer">
<div class="card-footer">
<input type="submit" class="btn btn-finish btn-fill btn-rose btn-wd" name="Save" value="Save">
<input type="reset" class="btn btn-finish btn-fill btn-danger btn-wd" name="reset" value="Reset">
</div>
</div>
</div>
</div>
</div>
@section Scripts
@Scripts.Render("~/bundles/jqueryval")
Here is My controller
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using RedICMVC.Models;
using RedICMVC.Common.Toaster;
using System.Data.SqlClient;
namespace RedICMVC.Controllers.Masters
public class CurrencyController : Controller
protected RedICMVCDBEntities Db = new RedICMVCDBEntities();
// GET: Currency
public ActionResult CurrencyDetail()
var sprecult = Db.Currencies.ToList();
return View(sprecult);
public ActionResult AddCurrency()
return View();
[HttpPost]
public ActionResult AddCurrency(SpCurrency cr)
if (cr.SR == 0)
var spresult = Db.Sp_Currency_Insert(cr.Currency, cr.Cur_Name, cr.MainCurrency, cr.CoinCurrency, cr.ExRate);
if (spresult == 1
else
var spresult = Db.Sp_Currency_Update(cr.SR, cr.Currency, cr.Cur_Name, cr.MainCurrency, cr.CoinCurrency, cr.Symbol, cr.ExRate);
if(spresult==1
return View();
[HttpGet]
public ActionResult GetRecordFromId(int id)
var idParam = new SqlParameter
ParameterName = "SR",
Value = id
;
var courseList = Db.Database.SqlQuery<SpCurrency>("exec sp_Currency_Get @SR", idParam).FirstOrDefault<SpCurrency>();
return View("AddCurrency", courseList);
public ActionResult DeleteConfirmed(int id)
var spresult = Db.sp_Currency_Delete(id);
if (spresult == 1
this is an image of output with both (Error and What I want in output)
Output image
Please, Can anyone give me a solution.?
Thank You in advance.
@model IEnumerable<RedICMVC.Models.Currency>
@
ViewBag.Title = "CurrencyDetail";
Layout = "~/Views/Shared/_Layout.cshtml";
<div class="card">
<div class="card-header card-header-primary card-header-icon">
<div class="card-icon">
<i class="material-icons">assignment</i>
</div>
<h4 class="card-title">Currency Details</h4>
<p style="float:right">
<a class="btn btn-primary" onclick="AddEdit()">
<i class="material-icons">add</i>Add Currency
</a>
</p>
</div>
<div class="card-body">
<div class="material-datatables">
<table id="datatables" class="table table-striped table-bordered dt-responsive table-hover text-center" cellspacing="0" width="100%" style="width:100%">
<thead>
<tr>
<th></th>
<th>
@Html.DisplayNameFor(model => model.SR)
</th>
<th>
@Html.DisplayNameFor(model => model.Currency1)
</th>
<th>
@Html.DisplayNameFor(model => model.Cur_Name)
</th>
<th>
@Html.DisplayNameFor(model => model.MainCurrency)
</th>
<th>
@Html.DisplayNameFor(model => model.CoinCurrency)
</th>
<th>
@Html.DisplayNameFor(model => model.ExRate)
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
<a href="#" data-toggle="modal" data-id="@item.SR" data-target="#confirmDelete" data-title="Delete Currency" data-message="Are you sure you want to delete this currency ?">
<i class="material-icons icon_size">delete</i>
</a>
</td>
<td>
@Html.DisplayFor(modelItem => item.SR)
</td>
<td>
@Html.DisplayFor(modelItem => item.Currency1)
</td>
<td>
@Html.DisplayFor(modelItem => item.Cur_Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.MainCurrency)
</td>
<td>
@Html.DisplayFor(modelItem => item.CoinCurrency)
</td>
<td>
@Html.DisplayFor(modelItem => item.ExRate)
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@Html.Partial("DialogBox", "Home")
<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="model1" class="modal fade">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
@*<h4 class="modal-title">Add Unit</h4>*@
</div>
<div class="modal-body" id="modelBody">
</div>
</div>
</div>
</div>
@section scripts
<script>
var AddEdit = function (SR)
var url = "/Currency/AddCurrency?id=" + SR;
$("#modelBody").load(url, function ()
$("#model1").modal("show");
)
$('.commanId').click(function ()
debugger;
var id = $(this).val();
$.get("/Currency/GetRecordFromId?id=" + id, function (data, status)
debugger;
var url = "/Currency/GetRecordFromId?id=" + id;
$("#modelBody").load(url, function ()
$("#model1").modal("show");
)
);
);
</script>
@model IEnumerable<RedICMVC.Models.Currency>
@
ViewBag.Title = "CurrencyDetail";
Layout = "~/Views/Shared/_Layout.cshtml";
<div class="card">
<div class="card-header card-header-primary card-header-icon">
<div class="card-icon">
<i class="material-icons">assignment</i>
</div>
<h4 class="card-title">Currency Details</h4>
<p style="float:right">
<a class="btn btn-primary" onclick="AddEdit()">
<i class="material-icons">add</i>Add Currency
</a>
</p>
</div>
<div class="card-body">
<div class="material-datatables">
<table id="datatables" class="table table-striped table-bordered dt-responsive table-hover text-center" cellspacing="0" width="100%" style="width:100%">
<thead>
<tr>
<th></th>
<th>
@Html.DisplayNameFor(model => model.SR)
</th>
<th>
@Html.DisplayNameFor(model => model.Currency1)
</th>
<th>
@Html.DisplayNameFor(model => model.Cur_Name)
</th>
<th>
@Html.DisplayNameFor(model => model.MainCurrency)
</th>
<th>
@Html.DisplayNameFor(model => model.CoinCurrency)
</th>
<th>
@Html.DisplayNameFor(model => model.ExRate)
</th>
</tr>
</thead>
<tbody>
@foreach (var item in Model)
<a href="#" data-toggle="modal" data-id="@item.SR" data-target="#confirmDelete" data-title="Delete Currency" data-message="Are you sure you want to delete this currency ?">
<i class="material-icons icon_size">delete</i>
</a>
</td>
<td>
@Html.DisplayFor(modelItem => item.SR)
</td>
<td>
@Html.DisplayFor(modelItem => item.Currency1)
</td>
<td>
@Html.DisplayFor(modelItem => item.Cur_Name)
</td>
<td>
@Html.DisplayFor(modelItem => item.MainCurrency)
</td>
<td>
@Html.DisplayFor(modelItem => item.CoinCurrency)
</td>
<td>
@Html.DisplayFor(modelItem => item.ExRate)
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
@Html.Partial("DialogBox", "Home")
<div aria-hidden="true" aria-labelledby="myModalLabel" role="dialog" tabindex="-1" id="model1" class="modal fade">
<div class="modal-dialog modal-md">
<div class="modal-content">
<div class="modal-header">
<button aria-hidden="true" data-dismiss="modal" class="close" type="button">×</button>
@*<h4 class="modal-title">Add Unit</h4>*@
</div>
<div class="modal-body" id="modelBody">
</div>
</div>
</div>
</div>
@section scripts
<script>
var AddEdit = function (SR)
var url = "/Currency/AddCurrency?id=" + SR;
$("#modelBody").load(url, function ()
$("#model1").modal("show");
)
$('.commanId').click(function ()
debugger;
var id = $(this).val();
$.get("/Currency/GetRecordFromId?id=" + id, function (data, status)
debugger;
var url = "/Currency/GetRecordFromId?id=" + id;
$("#modelBody").load(url, function ()
$("#model1").modal("show");
)
);
);
</script>
@model RedICMVC.Models.SpCurrency
@
ViewBag.Title = "AddCurrency";
Layout = null;
<!DOCTYPE html>
<div class="card">
<div class="card-header card-header-rose card-header-icon">
<div class="card-icon">
<i class="material-icons">details</i>
</div>
<h4 class="card-title">Add Currency</h4>
</div>
<div class="card-body">
@using (Html.BeginForm("AddCurrency", "Currency", FormMethod.Post, new enctype = "multipart/form-data" ))
@Html.AntiForgeryToken()
@Html.ValidationSummary(true, "", new @class = "text-danger" )
<div class="row justify-content-center">
<div class="col-lg-10">
<div class="form-group require">
@Html.EditorFor(model => model.Currency, new htmlAttributes = new @class = "form-control", @placeholder = "Currency" )
@Html.ValidationMessageFor(model => model.Currency, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.Cur_Name, new htmlAttributes = new @class = "form-control", @placeholder = "Currency Name" )
@Html.ValidationMessageFor(model => model.Cur_Name, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.MainCurrency, new htmlAttributes = new @class = "form-control", @placeholder = "Main Currency" )
@Html.ValidationMessageFor(model => model.MainCurrency, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.CoinCurrency, new htmlAttributes = new @class = "form-control", @placeholder = "Coin Currency" )
@Html.ValidationMessageFor(model => model.CoinCurrency, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.ExRate, new htmlAttributes = new @class = "form-control", @placeholder = "Excext Rate" )
@Html.ValidationMessageFor(model => model.ExRate, "", new @class = "text-danger" )
</div>
</div>
<div class="card-footer">
<div class="card-footer">
<input type="submit" class="btn btn-finish btn-fill btn-rose btn-wd" name="Save" value="Save">
<input type="reset" class="btn btn-finish btn-fill btn-danger btn-wd" name="reset" value="Reset">
</div>
</div>
</div>
</div>
</div>
@section Scripts
@Scripts.Render("~/bundles/jqueryval")
@model RedICMVC.Models.SpCurrency
@
ViewBag.Title = "AddCurrency";
Layout = null;
<!DOCTYPE html>
<div class="card">
<div class="card-header card-header-rose card-header-icon">
<div class="card-icon">
<i class="material-icons">details</i>
</div>
<h4 class="card-title">Add Currency</h4>
</div>
<div class="card-body">
@using (Html.BeginForm("AddCurrency", "Currency", FormMethod.Post, new enctype = "multipart/form-data" ))
@Html.AntiForgeryToken()
@Html.ValidationSummary(true, "", new @class = "text-danger" )
<div class="row justify-content-center">
<div class="col-lg-10">
<div class="form-group require">
@Html.EditorFor(model => model.Currency, new htmlAttributes = new @class = "form-control", @placeholder = "Currency" )
@Html.ValidationMessageFor(model => model.Currency, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.Cur_Name, new htmlAttributes = new @class = "form-control", @placeholder = "Currency Name" )
@Html.ValidationMessageFor(model => model.Cur_Name, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.MainCurrency, new htmlAttributes = new @class = "form-control", @placeholder = "Main Currency" )
@Html.ValidationMessageFor(model => model.MainCurrency, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.CoinCurrency, new htmlAttributes = new @class = "form-control", @placeholder = "Coin Currency" )
@Html.ValidationMessageFor(model => model.CoinCurrency, "", new @class = "text-danger" )
</div>
</div>
<div class="col-lg-10">
<div class="form-group">
@Html.EditorFor(model => model.ExRate, new htmlAttributes = new @class = "form-control", @placeholder = "Excext Rate" )
@Html.ValidationMessageFor(model => model.ExRate, "", new @class = "text-danger" )
</div>
</div>
<div class="card-footer">
<div class="card-footer">
<input type="submit" class="btn btn-finish btn-fill btn-rose btn-wd" name="Save" value="Save">
<input type="reset" class="btn btn-finish btn-fill btn-danger btn-wd" name="reset" value="Reset">
</div>
</div>
</div>
</div>
</div>
@section Scripts
@Scripts.Render("~/bundles/jqueryval")
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using RedICMVC.Models;
using RedICMVC.Common.Toaster;
using System.Data.SqlClient;
namespace RedICMVC.Controllers.Masters
public class CurrencyController : Controller
protected RedICMVCDBEntities Db = new RedICMVCDBEntities();
// GET: Currency
public ActionResult CurrencyDetail()
var sprecult = Db.Currencies.ToList();
return View(sprecult);
public ActionResult AddCurrency()
return View();
[HttpPost]
public ActionResult AddCurrency(SpCurrency cr)
if (cr.SR == 0)
var spresult = Db.Sp_Currency_Insert(cr.Currency, cr.Cur_Name, cr.MainCurrency, cr.CoinCurrency, cr.ExRate);
if (spresult == 1
else
var spresult = Db.Sp_Currency_Update(cr.SR, cr.Currency, cr.Cur_Name, cr.MainCurrency, cr.CoinCurrency, cr.Symbol, cr.ExRate);
if(spresult==1
return View();
[HttpGet]
public ActionResult GetRecordFromId(int id)
var idParam = new SqlParameter
ParameterName = "SR",
Value = id
;
var courseList = Db.Database.SqlQuery<SpCurrency>("exec sp_Currency_Get @SR", idParam).FirstOrDefault<SpCurrency>();
return View("AddCurrency", courseList);
public ActionResult DeleteConfirmed(int id)
var spresult = Db.sp_Currency_Delete(id);
if (spresult == 1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using RedICMVC.Models;
using RedICMVC.Common.Toaster;
using System.Data.SqlClient;
namespace RedICMVC.Controllers.Masters
public class CurrencyController : Controller
protected RedICMVCDBEntities Db = new RedICMVCDBEntities();
// GET: Currency
public ActionResult CurrencyDetail()
var sprecult = Db.Currencies.ToList();
return View(sprecult);
public ActionResult AddCurrency()
return View();
[HttpPost]
public ActionResult AddCurrency(SpCurrency cr)
if (cr.SR == 0)
var spresult = Db.Sp_Currency_Insert(cr.Currency, cr.Cur_Name, cr.MainCurrency, cr.CoinCurrency, cr.ExRate);
if (spresult == 1
else
var spresult = Db.Sp_Currency_Update(cr.SR, cr.Currency, cr.Cur_Name, cr.MainCurrency, cr.CoinCurrency, cr.Symbol, cr.ExRate);
if(spresult==1
return View();
[HttpGet]
public ActionResult GetRecordFromId(int id)
var idParam = new SqlParameter
ParameterName = "SR",
Value = id
;
var courseList = Db.Database.SqlQuery<SpCurrency>("exec sp_Currency_Get @SR", idParam).FirstOrDefault<SpCurrency>();
return View("AddCurrency", courseList);
public ActionResult DeleteConfirmed(int id)
var spresult = Db.sp_Currency_Delete(id);
if (spresult == 1
javascript jquery asp.net-mvc-4 bootstrap-modal
javascript jquery asp.net-mvc-4 bootstrap-modal
asked Mar 25 at 10:17
Company CompanyCompany Company
186 bronze badges
186 bronze badges
The 500 error is coming from the server side logic you call from$.get("/Currency/GetRecordFromId?id=" + id, ...I'd suggest checking the response text of the error to see the full stack trace and then stepping through the MVC logic to see where the exact issue is, as the JS itself is fine.
– Rory McCrossan
Mar 25 at 10:20
Response Text is blank in the browser...I trace many times but fail to catch an error..:(
– Company Company
Mar 25 at 10:33
In which case set a breakpoint and step through the C# code when you make a request
– Rory McCrossan
Mar 25 at 10:34
when Get request call I put a debugger and it will work...but after calling in the bracket I put debugger ...at that point response not come.that debugger not work
– Company Company
Mar 25 at 10:42
add a comment |
The 500 error is coming from the server side logic you call from$.get("/Currency/GetRecordFromId?id=" + id, ...I'd suggest checking the response text of the error to see the full stack trace and then stepping through the MVC logic to see where the exact issue is, as the JS itself is fine.
– Rory McCrossan
Mar 25 at 10:20
Response Text is blank in the browser...I trace many times but fail to catch an error..:(
– Company Company
Mar 25 at 10:33
In which case set a breakpoint and step through the C# code when you make a request
– Rory McCrossan
Mar 25 at 10:34
when Get request call I put a debugger and it will work...but after calling in the bracket I put debugger ...at that point response not come.that debugger not work
– Company Company
Mar 25 at 10:42
The 500 error is coming from the server side logic you call from
$.get("/Currency/GetRecordFromId?id=" + id, ... I'd suggest checking the response text of the error to see the full stack trace and then stepping through the MVC logic to see where the exact issue is, as the JS itself is fine.– Rory McCrossan
Mar 25 at 10:20
The 500 error is coming from the server side logic you call from
$.get("/Currency/GetRecordFromId?id=" + id, ... I'd suggest checking the response text of the error to see the full stack trace and then stepping through the MVC logic to see where the exact issue is, as the JS itself is fine.– Rory McCrossan
Mar 25 at 10:20
Response Text is blank in the browser...I trace many times but fail to catch an error..:(
– Company Company
Mar 25 at 10:33
Response Text is blank in the browser...I trace many times but fail to catch an error..:(
– Company Company
Mar 25 at 10:33
In which case set a breakpoint and step through the C# code when you make a request
– Rory McCrossan
Mar 25 at 10:34
In which case set a breakpoint and step through the C# code when you make a request
– Rory McCrossan
Mar 25 at 10:34
when Get request call I put a debugger and it will work...but after calling in the bracket I put debugger ...at that point response not come.that debugger not work
– Company Company
Mar 25 at 10:42
when Get request call I put a debugger and it will work...but after calling in the bracket I put debugger ...at that point response not come.that debugger not work
– Company Company
Mar 25 at 10:42
add a comment |
0
active
oldest
votes
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55335529%2ferror-jquery-min-js-return-500-internal-server-error%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
0
active
oldest
votes
0
active
oldest
votes
active
oldest
votes
active
oldest
votes
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55335529%2ferror-jquery-min-js-return-500-internal-server-error%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
The 500 error is coming from the server side logic you call from
$.get("/Currency/GetRecordFromId?id=" + id, ...I'd suggest checking the response text of the error to see the full stack trace and then stepping through the MVC logic to see where the exact issue is, as the JS itself is fine.– Rory McCrossan
Mar 25 at 10:20
Response Text is blank in the browser...I trace many times but fail to catch an error..:(
– Company Company
Mar 25 at 10:33
In which case set a breakpoint and step through the C# code when you make a request
– Rory McCrossan
Mar 25 at 10:34
when Get request call I put a debugger and it will work...but after calling in the bracket I put debugger ...at that point response not come.that debugger not work
– Company Company
Mar 25 at 10:42