This is a migrated thread and some comments may be shown as answers.

RadWindowManager.Open() does not keep url query string encoded values

2 Answers 71 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jason Rodman
Top achievements
Rank 1
Jason Rodman asked on 29 Dec 2010, 04:04 AM
I recently upgraded to the Q3 2010 version and noticed all my popup windows stopped working. What I found out was that when I open a window that has url arguments that are encoded, the radwindowmanager was decoding them when setting the url of the iframe. This caused my windows to break. For example, when I opened a dialog window I would pass it the path, an Id value and a url of where to redirect the parent page to. The the redirection url was encoded since it was a url itself. Here is an example:

/myproject/popups/page.aspx?id=1&url=%2fmyproject%2fotherpage.aspx%3fm%3dquestion%26id%3d
What happens is when the window opens, the IFrame's url is this instead:

/myproject/popups/page.aspx?id=1&url=/myproject/parentpage.aspx?m=question&id=
The encoded part of the query string has an "id=" parameter that interferes with the id value from the beginning of he query string. So in this scenario, I get a blank ID value on the server side since the ID is specified twice and the last one wins. I need the encoding to be preserved so these conflicts don't arise. Any suggestion how to fix this? This was working in previous versions before Q3. 

2 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 03 Jan 2011, 10:53 AM
Hello Jason,

I don't recall making any changes in the RadWindow control regarding this behavior and I tried to reproduce the problem locally but to no avail - RadWindow behaves just like a standard IFRAME in such scenario. For convenience I attached a small sample to this thread that shows how the argument is received in the content page. As you will see, in both cases, the Url is decoded which is expected.
Could you please check the demo and let me know if I have missed something?

Best wishes,
Georgi Tunev
the Telerik team
Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
0
Jason Rodman
Top achievements
Rank 1
answered on 03 Jan 2011, 04:53 PM
It turned out that this was being caused by the browser, not your window manager. The call to open the window was inside an anchor tag's href attribute like this:

<a href="javascript:openDialogWindow('/myproject/popups/page.aspx?id=1&url=%2fmyproject%2fotherpage.aspx%3fm%3dquestion%26id%3d');">Open</a>

For some reason when the openDialogWindow() function was called, the string value it received was decoded. I changed it to put the value in the onclick handler like this and it started working:

<a href="javascript:void(0);" onclick="openDialogWindow('/myproject/popups/page.aspx?id=1&url=%2fmyproject%2fotherpage.aspx%3fm%3dquestion%26id%3d');">Open</a>

I observed this behavior in Google chrome, and have not checked any other browsers. I apologize for the confusion and thank you for your quick response. Hopefully this thread can be helpful if anyone else comes across this problem.
Tags
Window
Asked by
Jason Rodman
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Jason Rodman
Top achievements
Rank 1
Share this question
or