- jquery.unobtrusive-ajax.min.js 的引用
jquery.unobtrusive-ajax.min.js的引用要在jquery.min.js的引用之后,否则会导致jquery.unobtrusive-ajax.min.js不生效
- jquery.unobtrusive-ajax.min.js 的使用
@using (Ajax.BeginForm("EditCategoryInfo", "CategoryInfo", new { }, new AjaxOptions() { HttpMethod = "post", OnSuccess = "afterEdit" }, new { id = "editForm" }))
{
}
- 通过radio的值选中对应的radio
$(":radio[name='status'][value='" + status + "']").prop("checked", "checked");
- 在Asp.net MVC中应该怎样使用Spring.Net?
- 先导入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>
<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