views:

28

answers:

2

My view url is /Customer/Detail/1

I'd like to update a div element in this view, but I cannot reach the action method.I'm using jQyery like this:

$.ajax({
            type: "POST",
            url: "List",
            data: formData,
            success: function(newHtml) {
                setTimeout(function() {
                     $("#grid").html(newHtml);
                }, 500);
            },

            error: function(request, textStatus, errorThrown) {
            alert("AJAX error: " + request.statusText);
            }
        });

The issue is with the url value. Eveything from this url attribute is added to the end of the actuall view url.So for this example I'll get /Customer/Detail/List but i need /Customer/List or even /Order/List

Is this possible ?

A: 

do method in /Customer/Detail/List and then redirect it to /Customer/List or /Order/List

Jack
Why I cannot call it direct ?
+2  A: 

Try typing the url with a starting slash. Like that:

url: "/Customer/List"

Alexander Vakrilov