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

The old 'window closes immediately'

2 Answers 76 Views
Window
This is a migrated thread and some comments may be shown as answers.
david
Top achievements
Rank 1
david asked on 31 Oct 2011, 09:54 PM
so I've use radwindow alot but now i have a case where the window opens and closes immediately, various threads say to do this in order to cancel the post back "(); return false;" like this:
<telerik:RadButton ID="btnNew" runat="server" OnClientClicked="ShowLectureAuthor(); return false;"   Text="New"
		 ToolTip="Create New File" Skin="Telerik">
		<Icon PrimaryIconUrl="~/images/fileimages/AddRecord.gif" PrimaryIconLeft="5px" />
<Icon PrimaryIconUrl="~/images/fileimages/AddRecord.gif" PrimaryIconLeft="5px"></Icon>
 </telerik:RadButton> 
the javascript which works, looks like this:
    function ShowLectureAuthor() {
        var oWindow = window.radopen("Admin-Lecture-Author.aspx"null);
        oWindow.SetTitle("Author Document");
        oWindow.SetModal(true);
} when I add the (); return false; I get errors on page load and none of the buttons work: Webpage error details

Message: Expected '}'
Line: 762
Char: 421
Code: 0

Really confused , thanks in advance

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 01 Nov 2011, 07:48 AM
Hello David,

You are getting the error because RadControls expects only sender and arguments as its default parameters. Here is the sample code that I tried which worked as expected.
aspx:
<telerik:RadButton ID="btnNew" Text="New" runat="server" AutoPostBack="false" OnClientClicked="ShowLectureAuthor">
</telerik:RadButton>

Also check the following help documentation.
Opening Windows.

-Shinu.
0
david
Top achievements
Rank 1
answered on 01 Nov 2011, 02:14 PM
Thank you for your quick response.

Tags
Window
Asked by
david
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
david
Top achievements
Rank 1
Share this question
or