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

telerik:RadWindowManager

2 Answers 75 Views
Window
This is a migrated thread and some comments may be shown as answers.
Sushmita
Top achievements
Rank 1
Sushmita asked on 25 Apr 2013, 07:17 AM

I have Master Page which is used by aspx page which is using ascx.

MasterPage -> aspx Page -> ascx Page
 
Master page contains 
<telerik:RadWindowManager>
  <ConfirmTemplate>
     <style></style>
  </ConfirmTemplate>
</telerik:RadWindowManager>

ascx contains
<telerik:RadWindowManager>
   <Windows>
     <telerik:RadWindow  OnClientShow = "wndChoiceShow"  OnClientClose = "wndChoiceClose"></telerik:RadWindow>
   </Windows>
</telerik:RadWindowManager>

Here, methods "wndChoiceShow" and "wndChoiceClose" are declared in JS file which is registered in Page_Init of ascx Page.

When browser cache is cleared, load is giving error "wndChoiceShow and wndChoiceClose are undefined". After that error is not coming.
Error is only coming first time after clearing the cache.

When I moved the methods "wndChoiceShow" and "wndChoiceClose" in <telerik:RadScriptBlock> block of master page no error is coming.

But this is not required. Need to have these methods in JS file only and should be registered in user control only.

Please help to resolve the issue.

2 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 26 Apr 2013, 01:39 PM
Hi Sushmita,

I would advise that you include the registration of the script file in the markup of the user control, e.g.
<script type="text/javascript" src="paht_to_the_file"></script>

Registering scripts from the code behind may not work with partial postbacks sometimes, especially if there is a check if the script has already been registered by the code. In this case the check will pass (the code thinks the script is registered), but the script is no longer in the browser because its cache has been cleared.


Greetings,
Marin Bratanov
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
Sushmita
Top achievements
Rank 1
answered on 06 May 2013, 11:28 AM

Hi Marin,


Thanx for your reply. Issue is resolved. I added <telerik:RadScriptBlock> in UserControl and defined methods wndChoiceShow and wndChoiceClose inside this block. It is working fine.


Sushmita

Tags
Window
Asked by
Sushmita
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Sushmita
Top achievements
Rank 1
Share this question
or