The old 'window closes immediately'

3 posts, 0 answers
  1. david
    david avatar
    228 posts
    Member since:
    May 2007

    Posted 31 Oct 2011 Link to this post

    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. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 01 Nov 2011 Link to this post

    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.
  3. david
    david avatar
    228 posts
    Member since:
    May 2007

    Posted 01 Nov 2011 Link to this post

    Thank you for your quick response.

Back to Top