Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Sunday, February 23, 2025 
 
slxdeveloper.com Community Forums  
   
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
 Web Forums - SalesLogix Web Platform & Application Architect
Forum to discuss the use of the SalesLogix Web Platform, Client and Customer Portals, and the Application Architect (For version 7.2 and higher only). View the code of conduct for posting guidelines.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Web Platform & Application Architect | New ThreadView:  Search:  
 Author  Thread: Initalize session variable from querystring
Steve Knowles
Posts: 657
Top 10 forum poster: 657 posts
 
Initalize session variable from querystringYour last visit to this thread was on 1/1/1970 12:00:00 AM
Posted: 16 Jun 08 9:42 AM
I want to initialize a session variable on the logon screen when a user is redirected there with a language parameter (ie. ...login.aspx?lang=de-DE). The page culture is then put into a session variable. The problem is that I need to refresh the page to get the culture to stick and have the localization take place on the login page. If I try to refesh the page in the onload event, it gets stuck in a loop of refreshment. I was doing this successfully with hyperlinks but the client would also like to be able to pass the language in the url.

I have this code in the page_onload of login.master:
string sLang = Request.QueryString["lang"];
if (sLang != "")
{
Session["MyCulture"] = sLang;
Server.Transfer(Request.Path);
}

This is the code that needs to fire in the login.aspx:
protected override void InitializeCulture()
{
//retrieve culture information from session
string culture = Convert.ToString(Session["MyCulture"]);

//check whether a culture is stored in the session
if (!string.IsNullOrEmpty(culture)) Culture = culture;
else Culture = "en-US";
//else Culture = m_DefaultCulture;

//set culture to current thread
Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(culture);
Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture);

//call base class
base.InitializeCulture();
}
[Reply][Quote]
 Page 1 of 1 
  You can subscribe to receive a daily forum digest in your user profile. View the site code of conduct for posting guidelines.

   Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 2/23/2025 11:08:57 AM