0

I am trying to load a partial view based on the current selected value in a dropdown list. My code works when I hard code the url...

$(document).ready(function () {
    $('#accountDropdownList').change(function () {
        var value = $(this).attr('value');
        $('#addressDetails').html('').load("http://localhost:52477/Account/Details/", { id: value }, function (data) { });

        return;
    });
});

but I want to use a virtual address like in my asp.net mvc 3 in c# views

@Html.Action("Details", "Account", new { id = value })

Is there anyway to resolve the controller and method names to a complete url?

Thanks.

Tim Blackwell
  • 699
  • 1
  • 7
  • 18
  • you can use also relative path: .load("/Account/Details/", { id: value }, function (data) { }); – Marian Ban Jul 24 '12 at 16:02
  • Thank you! Works perfectly. I did how ever try this before and it returned http://localhost:52477/Invoice/Edit/1/Account/Details/ rather than http://localhost:52477/Account/Details/ so dont know what i did wrong the first time. – Tim Blackwell Jul 24 '12 at 16:30

0 Answers0