1. get spring.core/spring.web from sourceforge's cvs
2.include spring.core,spring.web in your new web app
3.change your web.config like:
<configuration>
<configsections>
<sectiongroup name="spring">
<section name="context" type="spring.context.support.contexthandler, spring.core"/>
</sectiongroup>
</configsections>
<spring>
<context type="spring.context.support.webapplicationcontext, spring.web">
<resource uri="~/spring-objects.xml"/>
</context>
</spring>
<system.web>
<httphandlers>
<add verb="*" path="*.aspx" type="spring.web.support.pagehandlerfactory, spring.web"/>
</httphandlers>
//.....default web.config begin.....
<compilation defaultlanguage="c#" debug="true" />
.....
4.in the root, add a file: spring-objects.xml (defined in web.config <context type>...). like:
<?xml version="1.0" encoding="utf-8" ?>
<objects>
<object id="masterpage" type="~/master.aspx" />
<object id="basepage" abstract="true">
<property name="master">
<ref object="masterpage"/>
</property>
</object>
<object id="default" type="default.aspx" parent="basepage" />
<object id=the_file_name type=the_full_name />
<object id="messagesource" type="spring.context.support.resourcesetmessagesource, spring.core">
<property name="resourcemanagers">
<list>
<value>springnet.web.ui.head, springnet.web.ui</value>
<value>your_web_form_with_dir_name,your_assembly</value>
</list>
</property>
</object>
</objects>
5.add a asp:label in your default.aspx, named label1;
6. chang in default.aspx.cs:
public class default:system.web.ui.page => public class default: spring.web.ui.page
7.add in your resource files: label1.text = chang_to_localized_text
8. then, your are at the end:
files you need:
/web.config
/spring-objects.xml
/default..zh-cn.resx
/default.en-us.resx
/default.aspx.resx
/default.aspx.cs
/default.aspx
新闻热点
疑难解答
图片精选