Does anyone know how to call a controller in a view using ajacks?
I have got an umbraco project which i call the controllers for it via mvc. It works fine, but when i want to use ajax i get this error:
Object not found.... the code it:
function DoPostcodeLookup(postalCode) {
//var postalCode = $('#comppostcodelookup').val();
alert(postalCode);
$.ajax({
type: 'GET',
url: '@Url.RequestContext.HttpContext.Request.Url.GetLeftPart(UriPartial.Authority)/Employer/GetPostalCodeAddresses',
dataType: 'json',
cache: false,
data: { postalCode: postalCode },
success: function (data) {
if (data.Success) {
alert("Data has arrived");
$.each(data.Addresses, function () {
Ajax calls not working in umbraco...
Hello,
Does anyone know how to call a controller in a view using ajacks? I have got an umbraco project which i call the controllers for it via mvc. It works fine, but when i want to use ajax i get this error: Object not found.... the code it:
function DoPostcodeLookup(postalCode) { //var postalCode = $('#comppostcodelookup').val(); alert(postalCode); $.ajax({ type: 'GET', url: '@Url.RequestContext.HttpContext.Request.Url.GetLeftPart(UriPartial.Authority)/Employer/GetPostalCodeAddresses', dataType: 'json', cache: false, data: { postalCode: postalCode }, success: function (data) { if (data.Success) { alert("Data has arrived"); $.each(data.Addresses, function () {
Hi Mitra,
Have you seen this? http://our.umbraco.org/documentation/Reference/WebApi/
I haven't used it myself and don't know how useful / relevant to your version it is, but may be it's what you are looking for?
Zakhar
Hello,
Maybe this post can help: http://our.umbraco.org/projects/developer-tools/hybrid-framework/hybrid-framework/47815-Using-Ajax-with-the-framework
Jeroen
Thank a lot - We started to use SurfaceController. The articles you sent was very useful.
Regards, Mitra
Hello,
Could you please mark a post as the solution if it helped you.
Jeroen
is working on a reply...