Different Language with Sitemap ASP.NET 4.0
For Set up Custom Error Page these are the setup for it.
If you are using IIS 7.0 of Web server, these are link to how we can create custom error page for error 404.
<httpErrors errorMode="Custom" existingResponse="Auto">
<clear />
<error statusCode="404" prefixLanguageFilePath="" path="/error/errorsitemap.aspx?status=404" responseMode="ExecuteURL" />
<error statusCode="401" prefixLanguageFilePath="" path="/error/default.aspx?status=401" responseMode="ExecuteURL" />
<error statusCode="403" prefixLanguageFilePath="" path="/error/default.aspx?status=403" responseMode="ExecuteURL" />
<error statusCode="405" prefixLanguageFilePath="" path="/error/default.aspx?status=405" responseMode="ExecuteURL" />
<error statusCode="406" prefixLanguageFilePath="" path="/error/default.aspx?status=406" responseMode="ExecuteURL" />
<error statusCode="410" prefixLanguageFilePath="" path="/error/default.aspx?status=404" responseMode="ExecuteURL" />
<error statusCode="412" prefixLanguageFilePath="" path="/error/default.aspx?status=412" responseMode="ExecuteURL" />
<error statusCode="500" prefixLanguageFilePath="" path="/error/default.aspx?status=500" responseMode="ExecuteURL" />
<error statusCode="501" prefixLanguageFilePath="" path="/error/default.aspx?status=501" responseMode="ExecuteURL" />
<error statusCode="502" prefixLanguageFilePath="" path="/error/default.aspx?status=502" responseMode="ExecuteURL" />
httpErrors>
if you’re using Custom Error Mode
<customErrors defaultRedirect="/error/errorsitemap.aspx" mode="On" redirectMode="ResponseRewrite" >
<error statusCode="404" redirect="/error/errorsitemap.aspx?status=404" />
<error statusCode="500" redirect="/error/default.aspx?status=500" />
…… All the error code has to come here like above httpErrors section
customErrors>
If you are using Site map like flowing example
Web.CA.en-CA.sitemap
Web.CA.en-US.sitemap
Web.CA.fr-CA.sitemap
Then have to overwrite InitializeCulture() method of page.
Protected override void InitializeCulture()
{
//Resetting the culture when the URL is contain fr
int rawLocalizeUrl = Request.RawUrl.IndexOf("/fr/");
if (rawLocalizeUrl >= 0)
{
UICulture = "fr-CA";
}
base.InitializeCulture();
}
Other wise
v Microsoft .NET Framework 4: What is New in Globalization Can be found in following links.
Localization with script
1 comment:
I really liked your blog post.Much thanks again. Awesome.
Oracle SCM online training
Oracle SCM training
Oracle SOA online training
Oracle SOA training
Oracle sql plsql online training
Oracle sql plsql training
Oracle Web logic online training
Oracle Web logic training
OSB online training
OSB training
OTM online training
OTM training
Post a Comment