Localization/masterpage in asp.net 1.1 with spring.net

Source: Internet
Author: User
Asp.net|erp

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>

<add verb= "*" path= "*.aspx" type= "Spring.Web.Support.PageHandlerFactory, Spring.web"/>

... 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




Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.