Help with urlrewriting.net
-
Hi, I am working with asp.net multilingual project. I am using the following code to change the culture. a button to call the even //change the language as user selected protected void RequestLanguageChange_Click(object sender, EventArgs e) { if (Session["isError"] == null) { LinkButton senderLink = sender as LinkButton; //store requested language as new culture in the session Session["LanguagePreference"] = senderLink.CommandArgument; //reload last requested page with new culture Server.Transfer(Request.Path); } } then in my base page class I am initializing the culture as requested by first. protected override void InitializeCulture() { //retrieve culture information from session //string culture = Convert.ToString(Session[Global.SESSION_KEY_CULTURE]); string culture = Convert.ToString(Session["LanguagePreference"]); //check whether a culture is stored in the session if (culture.Length > 0) Culture = culture; //set culture to current thread Thread.CurrentThread.CurrentCulture = CultureInfo.CreateSpecificCulture(culture); Thread.CurrentThread.CurrentUICulture = new CultureInfo(culture); Session["LanguagePreference"] = culture; //call base class base.InitializeCulture(); } Now I am trying to use urlrewrite here for which I have added reference and defined the regex too. The problem is when I change the language when on a urlrewritten page, when doing Server.Transfer(Request.Path); it takes the url of the path but I need the original url for changing the language. Any suggestions how I can get the original path(url) for that. Thanks
Vijay V. Yash Softech