17.03.24 OA项目问题记录

  1. jquery.unobtrusive-ajax.min.js 的引用
    jquery.unobtrusive-ajax.min.js的引用要在jquery.min.js的引用之后,否则会导致jquery.unobtrusive-ajax.min.js不生效
  2. jquery.unobtrusive-ajax.min.js 的使用
@using (Ajax.BeginForm("EditCategoryInfo", "CategoryInfo", new { }, new AjaxOptions() { HttpMethod = "post", OnSuccess = "afterEdit" }, new { id = "editForm" }))
{
}
  1. 通过radio的值选中对应的radio
 $(":radio[name='status'][value='" + status + "']").prop("checked", "checked");
  1. 在Asp.net MVC中应该怎样使用Spring.Net?
  2. 先导入dll文件
Spring.Core.dll
Spring.Web.dll
Spring.Web.Mvc4.dll
  • 创建Config文件夹,创建xml文件
  • 在xml文件写入相关的配置信息
// controller.xml
<?xml version="1.0" encoding="utf-8" ?>
<objects xmls="http://www.springframework.net">
<object type="Caty.OA.WebApp.Controllers.CategoryInfoController,Caty.OA.WebApp" singleton="false">
<property name="CategoryInfoService" ref="CategoryInfoService"/>
</object>
</objects>
// services.xml
<?xml version="1.0" encoding="utf-8" ?>
<objects>
  <object type="Caty.OA.BLL.CategoryInfoService,Caty.OA.BLL" singleton="false" name="CategoryInfoService">
  </object>
</objects>
  • 修改Web.config文件中的配置
<configuration>
  <configSections>
    <sectionGroup name="spring"><!--Spring.Net配置-->
      <section name="context" type="Spring.Context.Support.MvcContextHandler, Spring.Web.Mvc4" />
      <section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core" />
    </sectionGroup>
  </configSections>
  <spring><!--Spring.Net配置-->
    <context>
      <resource uri="file://~/Config/controllers.xml" />
      <resource uri="file://~/Config/services.xml" />
    </context>
  </spring>
  <!--Spring.Net配置结束-->
</configuration>
  • 修改Global文件,继承SpringMvcApplication
 public class MvcApplication : SpringMvcApplication //System.Web.HttpApplication
    {
        protected void Application_Start()
        {
            AreaRegistration.RegisterAllAreas();
            RouteConfig.RegisterRoutes(RouteTable.Routes);
        }
    }
  • 注意使用Spring.Net要先导入Web.api
最后编辑于
©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,986评论 19 139
  • Spring Boot 参考指南 介绍 转载自:https://www.gitbook.com/book/qbgb...
    毛宇鹏阅读 46,970评论 6 342
  • 1. Java基础部分 基础部分的顺序:基本语法,类相关的语法,内部类的语法,继承相关的语法,异常的语法,线程的语...
    子非鱼_t_阅读 31,767评论 18 399
  • 一. Java基础部分.................................................
    wy_sure阅读 3,838评论 0 11
  • 和老婆结婚有几年了,从来没有吵过架,没有面红耳赤的时候,所以她同事眼里虽然没有钱,但是比同事看着都幸福,因为整天没...
    荣耀阅读阅读 354评论 0 0