我在我的项目中使用JsTree.我想这样做:
我想在单击根节点(+)或子节点时显示子节点后第一次加载树时,只显示根节点.我的意思是,当我点击每个节点时,我想从数据库中获取并添加到子节点.
我怎么能在Asp.Net MVC中做到这一点?我查看了几乎每个JsTree Ajax示例.但我不能这样做.我该怎么回事呢?我该怎么做我的行动请帮忙!
JsTree:https://www.jstree.com/
样品:
我如何在Asp.Net MVC 4中使用此URL(http://www.domain.com/friendly-content-title).
注意:此参数始终是动态的.网址可能有所不同:"friendly-content-title"
我尝试自定义属性,但我没有在ActionResult中捕获这个(友好内容标题)参数.
浏览次数:
的ActionResult:
// GET: /Home/
public ActionResult Index()
{
return View(Latest);
}
// GET: /Home/Video
public ActionResult Video(string permalink)
{
var title = permalink;
return View();
}
Run Code Online (Sandbox Code Playgroud)
RouteConfig:
public static void RegisterRoutes(RouteCollection routes)
{
routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
routes.MapRoute(
name: "Home Page",
url: "{controller}/{action}",
defaults: new { controller = "Home", action = "Index" }
);
routes.MapRoute(
name: "Video Page",
url: "{Home}/{permalink}",
defaults: new { controller = "Home", action = "Video", permalink = "" …Run Code Online (Sandbox Code Playgroud) asp.net-mvc ×2
c# ×2
custom-url ×1
dynamic ×1
java ×1
jstree ×1
security ×1
url-routing ×1
warnings ×1