Reputation: 38139
I have this which works in Visual Studio. It does not work when Published:
$.ajax({
url: "Order/EditLineItem",
data: { id: dataItem.id },
dataType: 'html',
success: function (data) {
$('#content').html(data); //
}
This, on the other hand, works when published, but not in Visual Studio:
$.ajax({
url: "/PropertySearch/Order/EditLineItem",
data: { id: dataItem.id },
dataType: 'html',
success: function (data) {
$('#content').html(data); //
}
The only difference is adding the site name "PropertySearch" at the start of the URL.
Is there some way to write this so that it works in both?
This is the current route:
routes.MapRoute(
name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "Order", action = "Start", id = UrlParameter.Optional }
);
Upvotes: 0
Views: 27
Reputation: 38139
The answer here is to:
Go to Project Property Page.
Web Tab
Find "Virtual Path:" and enter the site name.
Then when you run in VS, you will see the Virtual Path in the Browser address bar appended to the root.
Works for me.
Upvotes: 1