Note that there are some explanatory texts on larger screens.

plurals
  1. POWhat's going wrong with window.open here?
    primarykey
    data
    text
    <p>I'm encoding the parameters in a url and setting the href of an a tag as follows:</p> <pre><code>href="javascript:var win=window.open('LayerPreview.aspx?tLNUMCswKSXpnGpQy1rWev26c5euEUa97eqiZYdDpMvDcKNbi6Z05Q3WC5DhG%2b8HJFGHAo%2fHiSFrtEEsHiConkpaT2aJ2WV0Hxxqo2l1bmkNdAotVVvI%2fT4JtE%2fc3dJ8MEAhM3NJZ15qk3fkW87q9A%3d%3d','','width=800,height=600,resizable=no','true');" </code></pre> <p>But when the link is clicked, in the Page_Load of LayerPreview.aspx, the query string has been modified, i.e. the original:</p> <pre><code>tLNUMCswKSXpnGpQy1rWev26c5euEUa97eqiZYdDpMvDcKNbi6Z05Q3WC5DhG%2b8HJFGHAo%2fHiSFrtEEsHiConkpaT2aJ2WV0Hxxqo2l1bmkNdAotVVvI%2fT4JtE%2fc3dJ8MEAhM3NJZ15qk3fkW87q9A%3d%3d' </code></pre> <p>becomes:</p> <pre><code>tLNUMCswKSXpnGpQy1rWev26c5euEUa97eqiZYdDpMvDcKNbi6Z05Q3WC5DhG+8HJFGHAo%2fHiSFrtEEsHiConkpaT2aJ2WV0Hxxqo2l1bmkNdAotVVvI%2fT4JtE%2fc3dJ8MEAhM3NJZ15qk3fkW87q9A=%3d </code></pre> <p>This, obviously, screws up my decoding.</p> <p>Any ideas?</p> <p>Thanks,</p> <p>Carl.</p> <p><strong>Edit</strong>: I'm already using System.Web.HttpUtility.UrlEncode and System.Web.HttpUtility.Decode.</p> <p>Here's the operation:</p> <ol> <li>Generate the plain text query string.</li> <li>Encrypt the query string.</li> <li>Run it thru System.Web.HttpUtility.UrlEncode.</li> </ol> <p>When reading the query string I just do the opposite:</p> <ol> <li>Run it thru System.Web.HttpUtility.UrlDecode.</li> <li>Decrypt the query string.</li> <li>Read the query string.</li> </ol> <p>This works everywhere else in my web app but not when assinging the link for the window.open url or any other javascript method.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload