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

Problem with RadWindowManager

2 Answers 96 Views
Window
This is a migrated thread and some comments may be shown as answers.
Artur
Top achievements
Rank 1
Artur asked on 10 Feb 2011, 10:16 AM
Hello.
I use RadWindowManager to display alert windows.
I have code like this:

<telerik:RadWindowManager ID="window1" runat="server" ReloadOnShow="true"
EnableEmbeddedBaseStylesheet="false" EnableEmbeddedSkins="false" OnClientClose="javascript:alert('test')">
...
</telerik:RadWindowManager>

The problem is when I use this code without "OnClientClose" it works fine but whei I add "OnClientClose"
the alert is not displayed

Thanks.

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 10 Feb 2011, 11:27 AM
Hello Artur,

I am not quite sure about your issue. I have tried the same code and that throws error at my end so I have modified your code like below.
aspx:
<telerik:RadWindowManager ID="window1" runat="server" ReloadOnShow="true"  OnClientClose="ClientClose" >
</telerik:RadWindowManager>
Javascript:
function ClientClose()
  {
      alert("Test");
  }

Thanks,
Shinu.
0
Svetlina Anati
Telerik team
answered on 15 Feb 2011, 03:10 PM
Hello Artur,

 As Shinu mentioned, the problem comes from the fact that you have not correctly assigned the handler for the event. Please, note, that all the properties for client events for all RadControls should be assigned only to a function name (in the same manner you assign a server handler) - no parameters and brackets, because this will cause immediate execution instead of firing when the event takes place. In addition, no matter you do not pass any arguments, every function whose name you have assigned automatically receives a sender and eventArgs which you can use.

To get a better understanding especially for RadWindow (but the core logic is the same for all RadControls) I suggest to examine the following demo:

http://demos.telerik.com/aspnet-ajax/window/examples/clientsideevents/defaultcs.aspx?product=window

Greetings,
Svetlina
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.
Tags
Window
Asked by
Artur
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Svetlina Anati
Telerik team
Share this question
or