weixin_33690367 2016-05-12 23:58 采纳率: 0%
浏览 25

Ajax使用Sitecore进行呼叫

Currently I've read this resource http://www.bugdebugzone.com/2014/06/tutorial-how-to-make-ajax-call-in.html on how to make ajax calls with Sitecore. But I can see this getting out of hand as far as adding Routes to the Routes.config. What alternatives are there to adding routes to the config? Or maybe some way to read them in from a config file? Is there perhaps some "natural" way for Sitecore to pick up the controller and action?

  • 写回答

2条回答 默认 最新

  • weixin_33711641 2016-05-13 06:58
    关注

    Sitecore way to register routes is do the same that is described in article, but call it not from App_start folder. It should be called from one of processors in initialize pipeline.

    As example you could open your /sitecore/admin/showconfig.aspx, find initialize pipeline definition and look on Sitecore.Mvc.Pipelines.Loader.InitializeRoutes, Sitecore.Mvc, Sitecore.Cintel.Client.Initialization.InitializeRoutes, Sitecore.Cintel.Client or Sitecore.Cintel.Endpoint.Plumbing.InitializeRoutes, Sitecore.Cintel processors. Actually they do the same that is described in article that you have provided, difference is only in place where it is called.

    P.S. As for me call from initialize pipeline have one benefit: you can control order of routes collection.

    评论

报告相同问题?

悬赏问题

  • ¥15 电脑键盘实现触摸功能
  • ¥25 matlab无法将表达式转换为双数组怎么解决?
  • ¥15 单片机汇编语言相关程序
  • ¥20 家用射频美容仪技术规格
  • ¥15 大家帮我看看为什么错了
  • ¥15 unity互动琴弦抖动效果
  • ¥15 做了个的二极管反向饱和电流测量电路,但是测试达不到效果
  • ¥15 nginx无证书访问https失败
  • ¥15 树莓派启动AP热点传入数据
  • ¥15 multisim中关于74ls192n和DSWPK开关的问题(相关搜索:计数器)