Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Help with urlrewriting.net

Help with urlrewriting.net

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-netsysadminregex
1 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • V Offline
    V Offline
    VijayVishwakarma
    wrote on last edited by
    #1

    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

    1 Reply Last reply
    0
    Reply
    • Reply as topic
    Log in to reply
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes


    • Login

    • Don't have an account? Register

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • World
    • Users
    • Groups