Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Pages - General Discussions
Answered

Error switching language on power page when query string is present

(0) ShareShare
ReportReport
Posted on by 21

I've set up a power pages site from the blank template and done no customisation other than adding two additional languages.

 

I have a scenario where a query string parameter needs to be appended to the site/page address.

 

This all works fine except that when switching from one language to another using the switcher drop down on the site, it will url encode the query string, including the ? mark, which then results in an ASP.NET error. I disabled custom errors on the site to show the full exception message.

 

PDL_1-1699240921011.png

 

PDL_2-1699240946851.png

 

 

Categories:
  • Verified answer
    PDL Profile Picture
    21 on at
    Re: Error switching language on power page when query string is present

    I raised a ticket with MS and they confirmed a recent change has resulted in this default behavior. 

     

    The good news is that it can be switched off with a portal site setting called Site/EnableLanguageDropUrlEncoding.

     

    Set to false to switch off the encoding.

     

    PDL_0-1699578840016.png

     

  • LucasRoss232 Profile Picture
    6 on at
    Re: Error switching language on power page when query string is present

    This seems to be a recently introduced issue with the language.url_substitution liquid object. I've been able to fix it in a hacky way using the language.code and request.url liquid objects (removing the domain from request.url):

     

     

    href="/{{ language.code }}{{ request.url | remove: "domain/en-US" | remove: "domain/fr-FR" }}

     

    This seems to return the correct URL for language switching.

     

    Correction: This didn't actually work. Had to go with some Javascript function to change the href.

  • PDL Profile Picture
    21 on at
    Re: Error switching language on power page when query string is present

    Yep it's all working without the additional query parameter.

     

    When hovering on the link, you can see its encoded there. The rendered link in devtools shown

     

    PDL_0-1699308874953.png

     

    Feels like I may have to hack it with some javascript until this gets fixed.

  • oliver.rodrigues Profile Picture
    9,319 Most Valuable Professional on at
    Re: Error switching language on power page when query string is present
    • did you create the localized Web Page for the additional languages? 
    • is this working without the additional parameter?
    • does the URL look right when you just hover over the additional language? 

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Michael Gernaey – Community Spotlight

We are honored to recognize Michael Gernaey as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard > Power Pages

#1
Fubar Profile Picture

Fubar 69 Super User 2025 Season 1

#2
oliver.rodrigues Profile Picture

oliver.rodrigues 49 Most Valuable Professional

#3
Jon Unzueta Profile Picture

Jon Unzueta 43