I am developing an ASP.Net MVC 3 Web Application. I have a Razor View which enables the User to Create a new entry in the database. Within this Create View, there is a Drop Down List and when the User selects an option the following JQuery code fires
$(document).ready(function () {
$("#gradeID").change(ChangeEventOfDDL);
function ChangeEventOfDDL() {
var dropDownValue = $('#gradeID').val();
//alert(dropDownValue);
$.ajax({ type: "POST",
url: '/FormEmployment/CreateSpecialtiesPartialView/' + dropDownValue,
success: function (data) {
$('#SpecialtiesContent').html(data);
}
});
}
});
As you can see within this code I retrieve the selected Drop Down List value using
var dropDownValue = $('#gradeID').val();
When a User is Editing an entry, I wish to fire off a similar piece of code, only this time I would like to retrieve the entry ID in the QueryString which will look something like this
http://localhost:56354/FormEmployment/Edit/41
Does anyone know how I can get the value 41 using JQuery or is this even possible?
Thanks for your help.
Tony.