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

RadWindow and ASP.NET button

1 Answer 52 Views
Window
This is a migrated thread and some comments may be shown as answers.
Sohel
Top achievements
Rank 1
Sohel asked on 09 Dec 2008, 08:59 PM
I have an ASP.NET button on a user control. When I call RadWindow.Open() from a OnClienClick event handler the window seems to flash but never actually come up.  The button is doing a post back and there is no way from the ASP.NET button to cancel the postback.  Does anyone have an idea what I can do about it?

1 Answer, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 11 Dec 2008, 09:49 AM
Hello Sohel,

If I understand you correctly, this behavior occurs wen you hook a function that open RadWindow to the 'OnClientClick' on asp:Button build in WebUserControl.
To achieve the desired behavior you need to stop the post back when the button is clicked - this can be done by using the "return false;" operator:

<asp:Button ID="Button1" runat="server" OnClientClick="OpenRadWindow(); return false;" Text="Open RadWindow" /> 
 
<script type="text/javascript" language="javascript"
 
function GetRadWindow() 
 var oWindow = $find('<%= RadWindow1.ClientID %>' ) ; 
 return oWindow; 
function OpenRadWindow() 
var radWindow = GetRadWindow(); 
radWindow.show(); 


Sincerely yours,
Fiko
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Sohel
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Share this question
or