Spring.net页面属性注入

本文详细介绍了如何在spring.web程序集中进行配置,包括system.web、httpModules、system.webserver等部分的具体设置方法,并提供了spring.xml配置注意事项及页面属性设置示例。
1.条件spring.web程序集 
1.1 system.web配置
<httpHandlers>
      <add verb="*" path="*.aspx" type="Spring.Web.Support.PageHandlerFactory, Spring.Web"/>
</httpHandlers>
1.2 httpModules配置
<httpModules>
<add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.Web"/>
</httpModules>
1.3 system.webserver配置
  <system.webServer>
    <validation validateIntegratedModeConfiguration="false"/> 
    <modules>
      <add name="Spring" type="Spring.Context.Support.WebSupportModule, Spring.Web"/>
    </modules>
    <handlers>
      <add name="SpringPageHandler" verb="*" path="*.aspx" type="Spring.Web.Support.PageHandlerFactory,
 Spring.Web"/>
      <add name="SpringContextMonitor" verb="*" path="ContextMonitor.ashx" type="Spring.Web.Support.ContextMonitor,
 Spring.Web"/>  
    </handlers>
  </system.webServer>
1.4 spring xml配置 注意type要写web的文件路径否则会出错,网站大多是抄的,所以都只有一个Default.aspx,这里要特别注意否则功亏一篑

<object type="~/admin/Sys/SysDictTypeEdit.aspx">
<property name="Psvc" ref="SysDictTypeService"/>

</object>

<object id="SysDictTypeService" type="Bll.SysDictTypeService, HRABLL">
<property name="Dao" ref="CommonService"/>
<property n

1.5 页面放个属性就好了

private Contract.IService.ISysDictTypeService psvc;
/// <summary>
/// 初始化
/// </summary>
public Contract.IService.ISysDictTypeService Psvc
{
get;set;

}

 

 

 

转载于:https://www.cnblogs.com/kexb/p/5922415.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值