RadWindow not opening on client

3.7k Views Asked by At

I have a puzzling situation I need some help with here please. I am trying to cause my button to open a RadWindow( Another page in a PopUp), and I would appreciate any help I can get with this please.

I have a simple button on my form (A UserControl Form). What I would like to do is pop open a RadWindow when the button is clicked . What currently happens is a window opens and then closes, almost immediately.

I have the code below in my code behind

    Private Sub Page_Init(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Init
        BtnGenerateReport.Attributes("onclick") = " return GenerateSelectedReport('" & intPrimaryKey & "');"
    End Sub

And on the client side, I have

  function GenerateSelectedReport(reportid) {
       var wlink = "Popuppage.aspx?intRptKey=" + reportid
       window.radopen(wlink, "REPORT GENERATOR");
       oWnd.center();
       return true;
   }
2

There are 2 best solutions below

6
On BEST ANSWER

Why are you returning "true" in GenerateSelectedReport? Try changing it to false and see what happens.

The problem is occuring because the button is causing a postback that you need to cancel. Returning false will cancel the button action after the Javascript has run.

0
On

According to this article the return false statement should be inline with the call to the function like so

orderMaintenanceOpenWindow(); return false; 

So try removing the return false; from your js method and update your call to this:

BtnGenerateReport.Attributes("onclick") = " GenerateSelectedReport('" & intPrimaryKey & "'); return false;"