RadWindow 未在客户端上打开

发布于 2024-10-18 12:36:46 字数 672 浏览 2 评论 0原文

我遇到了一个令人困惑的情况,我需要一些帮助。我试图让我的按钮打开 RadWindow(弹出窗口中的另一个页面),如果我能得到任何帮助,我将不胜感激。

我的表单上有一个简单的按钮(用户控件表单)。我想做的是单击按钮时弹出一个 RadWindow。当前发生的情况是窗口打开然后关闭,几乎立即。

我的代码中有下面的代码

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

在客户端,我有

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

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;
   }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

冰火雁神 2024-10-25 12:36:46

为什么在GenerateSelectedReport中返回“true”?尝试将其更改为 false 并看看会发生什么。

出现此问题的原因是该按钮导致回发,您需要取消该回发。返回 false 将在 Javascript 运行后取消按钮操作。

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.

对你的占有欲 2024-10-25 12:36:46

根据这篇文章< /a> return false 语句应该与对函数的调用内联,如下所示

orderMaintenanceOpenWindow(); return false; 

所以尝试删除 return false;从你的 js 方法并将你的调用更新为:

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

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;"
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文