Localization/MasterPage in ASP.NET 1.1 with Spring.Net

王朝c#·作者佚名  2006-12-17
窄屏简体版  字體: |||超大  

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

 
 
 
免责声明:本文为网络用户发布,其观点仅代表作者个人观点,与本站无关,本站仅提供信息存储服务。文中陈述内容未经本站证实,其真实性、完整性、及时性本站不作任何保证或承诺,请读者仅作参考,并请自行核实相关内容。
 
 
© 2005- 王朝網路 版權所有 導航