RadWindow 未在客户端上打开
我遇到了一个令人困惑的情况,我需要一些帮助。我试图让我的按钮打开 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
为什么在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.
根据这篇文章< /a> return false 语句应该与对函数的调用内联,如下所示
所以尝试删除 return false;从你的 js 方法并将你的调用更新为:
According to this article the return false statement should be inline with the call to the function like so
So try removing the return false; from your js method and update your call to this: