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

RadWindow reload every time it opens

20 Answers 1203 Views
Window
This is a migrated thread and some comments may be shown as answers.
Vygintas
Top achievements
Rank 1
Vygintas asked on 06 Oct 2010, 10:57 AM
Hello,

I use Radwindow to display notes. There are 4 text fields and 4 buttons to display specific note in radwindow. Everything works fine until I change notes and open popup RadWindow to display saved note. RadWindow shows the old note. So i need to refresh window every time.

So, I have a problem to refresh RadWindow every time it opens. I can not use property ReloadOnShow, because I pass query parameters and telerik adds his own parameters at the end and it leads to error when I try to get query patameters throught Reqest["parameterName"]. I event tried to destroy window every time it closes, but no effect. Then I tried to create new radWindow(throught javascript) every time it opens and destroy after close, but somehow the data is still not refreshed. Then I desided to reload window every time it opens using radWindow.Reload(), but it led me to unexpected effect. I even disabled viewstate and again no effect.

What is the best practice to open radWindow and refresh everytime it opens?

20 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 08 Oct 2010, 12:15 PM
Hi Vygintas,

The recommended approach to show a new version of the content every time is exactly to use ReloadOnShow=true and ShowContentDuringLoad=false (to avoid users seeing the old version before the reload).
How exactly do you get the query string? Page.Request.QueryString["parameterName"] should work fine no matter what are the others argument in the string.


Greetings,
Georgi Tunev
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
sreelatha bora
Top achievements
Rank 1
answered on 09 Feb 2011, 11:11 AM
HI ,
        I have grid template column with anchor and image inside a radgrid as shown below

<

 

telerik:GridTemplateColumn UniqueName="" HeaderText="" HeaderStyle-Width="3%" ItemStyle-Width="3%" HeaderStyle-Font-Bold="true" ItemStyle-CssClass="RadGridItemStyle">
<ItemTemplate>
<a href="#" title="Note" onclick="openRadWindowArtifactNote('<%# Eval("StudyArtifactDetailId") %>'); return false;">
<img alt = "Note" border="0" src="/DesktopModules/CustomizedUserControls/DEP/Images/Note.gif"id="imgNote" runat="server" /><img alt = "Note" border="0" src = "/DesktopModules/CustomizedUserControls/DEP/Images/NoteHasData.gif" id = "imgNoteHasdata" runat="server" /></a></ItemTemplate></telerik:GridTemplateColumn>

on click of image it opens radwindow.radwindow loads with correct data when it 1st time opens. from the 2nd attempt it doesnot  reloading.i tried with ReloadOnShow=true  but no use. it behaves the same. page load event fires only 1st time it opens.from the 2nd time onwordspage load event not firing.please help me !!

 

 

function openRadWindowArtifactNote(ArtifactDetailId) {

 

 

var oWnd = radopen("/DesktopModules/CustomizedUserControls/DEP/ProjectPlan/ArtifactNote.aspx?ArtifactStr=" + ArtifactDetailId, "rdRemarksWindow");

 

oWnd.ReloadOnShow =

true;

 

oWnd.set_visibleStatusbar(

false);

 

oWnd.set_title(

'Note');

 

oWnd.SetWidth(500);

oWnd.SetHeight(350);

oWnd.center();

 

 

}

0
Georgi Tunev
Telerik team
answered on 09 Feb 2011, 01:26 PM
Hello sreelatha bora,

ReloadOnShow is set in the RadWindow / RadWindowManager's declaration.

All the best,
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
sreelatha bora
Top achievements
Rank 1
answered on 10 Feb 2011, 04:23 AM
HI, I set the property in the  radwindow declararion .but still not reloading.below is my rad manger code.

<

 

telerik:RadWindowManager AutoSize="false" ID="RadWindowManagerArtifact"

 

 

Width="820px" Height="350px" runat="server" Behaviors="Close" Style="z-index: 15000" ReloadOnShow="true">

 

 

<Windows>

 

 

<telerik:RadWindow ID="rdFileUploadWindow" runat="server" Behaviors="Close" ReloadOnShow="true" OnClientClose="OnClientClose"

 

 

NavigateUrl="/DesktopModules/CustomizedUserControls/DEP/ProjectPlan/UploadFile.aspx"

 

 

Width="450px" Height="220px">

 

 

</telerik:RadWindow>

 

 

<telerik:RadWindow ID="rdVersionWindow" runat="server" Behaviors="Close" Width="950px"

 

 

Height="375px">

 

 

</telerik:RadWindow>

 

 

<telerik:RadWindow ID="rdRemarksWindow" runat="server" Behaviors="Close" ReloadOnShow="true"

 

 

Width="500px" Height="250px" Style="z-index: 10000">

 

 

</telerik:RadWindow>

 

 

<telerik:RadWindow ID="rdRejectWindow" runat="server" Behaviors="Close" ReloadOnShow="true" Width="500px"

 

 

Height="300px" DestroyOnClose="true">

 

 

</telerik:RadWindow>

 

 

</Windows>

 

</

 

telerik:RadWindowManager>

 

0
Georgi Tunev
Telerik team
answered on 14 Feb 2011, 01:42 PM
Hi sreelatha bora,

Your markup looks OK, so at this point I cannot tell what the reason for the problem might be. Please open a support ticket and send a sample project that isolates the problem so we can investigate further.

Kind regards,
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
improwise
Top achievements
Rank 1
Iron
Iron
answered on 13 May 2011, 01:29 PM
Picking up on this, as we too have problems with the ReloadOnShow. Based on this and other threads, it seems obvious that this setting does not work. So, what do we need to do to actually get the window to show itself with all controls set to their default state?
0
Georgi Tunev
Telerik team
answered on 16 May 2011, 10:46 AM
Hello Patrik,

Just to clarify - in this specific thread, we are talking about the need to have the RadWindow show fresh content every time it is opened. This is done, by setting its (or RadWindowManager's) ReloadOnShow=true (to force the window to show a fresh copy of the page every time) and ShowContentDuringLoad=false (to prevent users from seeing the old content while it is being reloaded).

So far (or at least since RadControls for ASP.NET AJAX were officially introduced - several years ago, there was indeed such problem with the classic version, but it was fixed), we haven't made changes in that logic and it is working as expected. Could you please share more details on your scenario?
  1. What is your RadWindow / RadWindowManager markup?
  2. How do you open the RadWindow?
  3. What exactly is the logic on the content page, that (as a result) indicates that there is a problem?
  4. What is the expected behavior?


Regards,
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
improwise
Top achievements
Rank 1
Iron
Iron
answered on 16 May 2011, 01:04 PM
1. This is the markup, I have cleared the ContentTemplate for easy reading, but the only editable control is a "confirm checkbox"

<telerik:RadWindow ID="radwindowCloseAccountConfirm" runat="server"
    Modal="True" Behaviors="Close, Move" VisibleStatusbar="False"
    AutoSize="True" MinWidth="650px" ReloadOnShow="True"
    ShowContentDuringLoad="False">
    <ContentTemplate>


    </ContentTemplate>
</telerik:RadWindow>

2. We use VisibleOnPageLoad = true to display the window

3. When the window is reopended, it will remember the value of the checkbox from last run

4. We want the checkbox to have its default value always, not remember the value from last time the windows was opended.

By using a:

((CheckBox)radwindowWindow.Controls[0].FindControl("checkboxApprove")).Checked = false

we have managed to work around the problem but still it is not a good solution, especially if you have many controls


0
Georgi Tunev
Telerik team
answered on 17 May 2011, 09:53 AM
Hello Patrik,

Thank you for the additional information - now I see what the problem is. The reason for it is that ReloadOnShow works for content pages only - this information is not clearly exposed in our documentation and I'll make sure that this is done for the next release.

ReloadOnShow works only for content pages, because it's logic makes sure that the Url is updated (by using a custom argument in the query string) on every call. This however, cannot be applied to the content template. There is no "reload" method for content template containers (in the framework) and the main reason for that is that there is no way to know what exactly the user /developer wants - should the content be reset, or should it preserve some values.
This being said, the only way to make sure that the content is reset on every show is to manually clear it, like you did in your last post.

I hope this information helps.


All the best,
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
improwise
Top achievements
Rank 1
Iron
Iron
answered on 18 May 2011, 01:50 PM
Well, glad to see that we agree on it not working :)

You say "ReloadOnShow works for content pages only", but what good is it then, if it only work with static content (which by obvious reason do not change from time to time). Or would it work if you do a:

myLabel..Text = "my text"

between VisibleOnPageLoads?

0
Georgi Tunev
Telerik team
answered on 19 May 2011, 09:56 AM
Hi Patrik,

Well, since its creation (about 6 years ago), RadWindow is often used by developers for displaying various forms in a popup. One of the first features that were requested by customers then, was the ability to show a fresh view of the form on every show - that is why ReloadOnShow was created. This was needed, because IE has a nasty habit of caching a content page, displayed in an IFRAME and the only way to avoid that caching was to either destroy the RadWindow object completely upon closing, which is not a desired logic in some scenarios, or to make sure that IE would load a new version of the content, by adding a random argument in the query string.


Greetings,
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
improwise
Top achievements
Rank 1
Iron
Iron
answered on 19 May 2011, 12:35 PM
You wrote "One of the first features that were requested by customers then, was the ability to show a fresh view of the form on every show - that is why ReloadOnShow was created." and I couldn't agree with you more, that is exactly what we want to happen as well, a fresh form. Only problem is, the ReloadOnShow doesn't work, any hopes of getting a ReloadOnShow that actually does? :)
0
Georgi Tunev
Telerik team
answered on 20 May 2011, 03:18 PM
Hello again Patrik,

As I said in my reply from 17.05. there is no generic way to clear the content in the INamingContainer like in the case when a content page is used. Of course, if we find a suitable way to do that, that would produce consistent result in all cases, we will implement it, but for now, the only way to do that is manually like you did.


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
Andrew
Top achievements
Rank 1
answered on 26 Aug 2011, 01:17 PM
So how is the situation right now??? I'm using the last version of controls and  still can not refresh ContentTemplate... Will this feature be implemented in future release?
0
Marin Bratanov
Telerik team
answered on 26 Aug 2011, 02:43 PM
Hi Andrew,

As my colleagues Georgi stated in his previous answers to this thread - there is no such method in the framework, therefore there is very little we can do on this point. Another comlication that also prevents research in this direction is the fact that the expected results of such a functionality are unclear - should the controls get empty values, how should databound controls react, how should controls like a label react?

This means that currently the only way to refresh the ContentTemplate is manually, as shown in Patrik's post from the 16th of May 2011.

Another possible option is to disable the viewstate for the controls inside RadWindow so that they do not preserve their values through postbacks.

If a suitable and consistent method of doing so is found it will be incorporated in the RadWindow, but for the time being the simply isn't such and this is a technology limitation which we cannot work around.


Best wishes,
Marin
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

0
gim.net
Top achievements
Rank 1
answered on 26 Nov 2012, 10:49 PM
In order to use ShowContentDuringLoad="true" to allow a better sense of progression to the clients
I have a good workaround for this issue:

1)              set  onclientclose="resetMyWindow" on the window definition.

2)              create a blank html page on your website.

3)     add this to your page:

                  <script type="text/javascript">

                          function resetMyWindow(sender,args) {
                                   sender.SetUrl('/blank.html');
                          }
                 </script>

That solved my problem.
0
Danail Vasilev
Telerik team
answered on 29 Nov 2012, 03:28 PM
Hello Eli,

This is NOT an issue with the control. We cannot reset custom controls in the ContentTemplate we know nothing about and how they should be reset, much less can we do it with JavaScript. As already stated - such a method does not exist in the framework and in the RadWIndow is merely a container. It is possible to reload an iframe by modifying its src and we already have this functionality in place.

Regarding the proposed option - simply setting ShowContentDuringLoad=false shows a loading indicator when external pages are used automatically, so a custom additional page is not needed. Note it is set to false.


All the best,
Danail Vasilev
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Satish
Top achievements
Rank 1
answered on 05 Jul 2016, 06:21 AM

Hello Georgi Tunev 

I have problem with radwindow. when the page is loading automatically radwindow model open for some time and close after page is get load.

i want to fix this issue ASAP

Please help me to resolve this issue.

0
Marin Bratanov
Telerik team
answered on 05 Jul 2016, 06:54 AM

Hello Satish,

There are several likely reasons for such behavior

  • a script in the content page that gets executed when it loads, and calls the close() method of the RadWindow or of the browser window object
  • a OnClientPageLoad handler that calls the close() method of the RadWindow
  • a form of frame buster in the content page


Regards,

Marin Bratanov
Telerik
Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
0
Satish
Top achievements
Rank 1
answered on 05 Jul 2016, 11:55 AM

Hello Marin Bratanov,

How could i resolved the problem.

 

Tags
Window
Asked by
Vygintas
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
sreelatha bora
Top achievements
Rank 1
improwise
Top achievements
Rank 1
Iron
Iron
Andrew
Top achievements
Rank 1
Marin Bratanov
Telerik team
gim.net
Top achievements
Rank 1
Danail Vasilev
Telerik team
Satish
Top achievements
Rank 1
Share this question
or