I have this code for the controller in "/Controllers/Cubo/FilterController.cs"
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using System.Web.Mvc.Ajax;
namespace Mkt.Web.Controllers.Cubo
{
public class FilterController : Controller
{
//
// GET: /Filter/
public ActionResult Index()
{
return View();
}
public ActionResult GetPeople()
{
return View("~/Views/Shared/Cubo/Filter/People.ascx");
}
public ActionResult GetAddress()
{
return View("~/Views/Shared/Cubo/Filter/Address.ascx");
}
}
}
Call in javascript with jQuery:
(function($) {
$.fn.loadFilter = function(name, data, fn) {
data = (typeof (data) == "undefined") ? {} : data;
fn = (typeof (fn) == "undefined") ? null : fn;
$(this).empty();
$(this).load("/Filter/Get" + name + "", data, fn);
};
})(jQuery);
$("#containerFilter").loadFilter("People");
But when I call "GetPeople" in "FilterController" I need to call without the directory name "Cube". How can I do to call with the directory name to get a better order?.
EDIT:
I would need to call as "$(this).load("/Cube/Filter/Get" + name + "", data, fn);
". Referred to "/Controllers/Cubo/FilterController.cs
"