Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6877719
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T04:38:05+00:00 2026-05-27T04:38:05+00:00

I am facing one issue because of URL encoding in window.open function when used

  • 0

I am facing one issue because of URL encoding in window.open function when used under href attribute of link.

Basically I am trying to open a generic popup in my site using window.open function.This popup page accept target page url which will be rendered inside the frame present on popup.aspx

But because of url encoding url parmater which I am passing getting truncated in popup.aspx.cs page.

The same window.open works correctly when directly called from JavaScript function.
But failing when embedded in Href attribute.

Below is the Code
Note: input url paramter is a proper decoded url using standard decoding function.

<a href="javascript:void window.open('Popup.aspx?url=%2FB2B%2FDEV%2FSHARE%2FGRID%2FXML_GRID_PAGE.ASP%3FGRIDTYPE%3D2%26SID%3D33172D0A-565A-43D7-8D50-5C223B6E8C24%26CAID%3D0%26ViewID%3DPATIENTPROFILE%26InstanceID%3D375660844%C3%BF14542276%C3%BF3%C3%BFSTANDARD','','scrollbars=yes,menubar=yes,resizable=yes,left=30,top=30,height=500,width=650')"> link</a>

My assumption is when window.open embedded inside the href then somehow its get decoded and then passed to target popup page.

Sample url seen in browser.

https://poorcmcdevvm15.xyz.com//b2b/mainmasterpage/popup.aspx?url=/B2B/DEV/SHARE/GRID/XML_GRID_PAGE.ASP?GRIDTYPE=2&SID=33172D0A-565A-43D7-8D50-5C223B6E8C24&CAID=0&ViewID=PATIENTPROFILE&InstanceID=375660844ÿ14542276ÿ3ÿSTANDARD

when same window.open called through javascript below is the url observed in browser

Popup.aspx?url=%2FB2B%2FDEV%2FSHARE%2FGRID%2FXML_GRID_PAGE.ASP%3FGRIDTYPE%3D2%26SID%3D33172D0A-565A-43D7-8D50-5C223B6E8C24%26CAID%3D0%26ViewID%3DPATIENTPROFILE%26InstanceID%3D375660844ÿ14542276ÿ3ÿSTANDARD

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-27T04:38:06+00:00Added an answer on May 27, 2026 at 4:38 am

    ================================================================================
    I Solved this problem, very simple fix.Initially I have encoded input url only once using encodeURIComponent function. But in my case decoding happens twice first in href attribute and second time on target dotnet page. So to solve this issue I have encoded input url parameter twice and this solved my problem.

    Sample Url after encoded twice using function encodeURIComponent

    <a href="javascript:void indow.open('Popup.aspx?url=%252FB2B%252FDEV%252FSHARE%252FGRID%252FXML_GRID_PAGE.ASP%253FGRIDTYPE%253D2%2526SID%253D33172D0A-565A-43D7-8D50-5C223B6E8C24%2526CAID%253D0%2526ViewID%253DPATIENTPROFILE%2526InstanceID%253D375660844%25C3%25BF14542276%25C3%25BF3%25C3%25BFSTANDARD','','scrollbars=yes,menubar=yes,resizable=yes,left=30,top=30,height=500,width=650')"> link2</a>

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am facing one issue related to multithreading because of shared code. I want
I am new to MVC and facing one issue. I have a xml file
I am facing one issue with linq query in c# , my linq query
I am facing one small issue. I want to change the parent div style
I am facing one issue regarding Layout of detail view in UISplitviewController. below is
I am facing issue in binding the gridview when one of the tag in
I am facing one issue It is not safe to use pixmaps outside the
I'm facing one issue while writing Office Outlook 2007 Add-In, I'm accessing the email
One of my colleagues is facing an issue with creating a test plan using
I am facing one issue, i am using time picker to display hours and

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.