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 metadata提取的PDF元数据,如何转换为一个Excel
  • ¥15 关于arduino编程toCharArray()函数的使用
  • ¥100 vc++混合CEF采用CLR方式编译报错
  • ¥15 coze 的插件输入飞书多维表格 app_token 后一直显示错误,如何解决?
  • ¥15 vite+vue3+plyr播放本地public文件夹下视频无法加载
  • ¥15 c#逐行读取txt文本,但是每一行里面数据之间空格数量不同
  • ¥50 如何openEuler 22.03上安装配置drbd
  • ¥20 ING91680C BLE5.3 芯片怎么实现串口收发数据
  • ¥15 无线连接树莓派,无法执行update,如何解决?(相关搜索:软件下载)
  • ¥15 Windows11, backspace, enter, space键失灵