[英]open child window in telerik radwindow
I want to open a child RadWindow with in a telerik:RadWindow with client side script, i have used "radopen", it showing a window but not exactly with same property and url as I configured. 我想在带有客户端脚本的telerik:RadWindow中打开子RadWindow,我使用了“ radopen”,它显示的是窗口,但属性和URL与我配置的不完全相同。 One more thing my Parent RadWindow is exists in a UserControl
UserControl中还存在我的父RadWindow的另一件事
this is my code: 这是我的代码:
<telerik:RadWindowManager ID="RadWindowManagerCustomValue" Style="overflow: hidden"
ShowContentDuringLoad="false" VisibleStatusbar="false" ReloadOnShow="True" IconUrl=""
DestroyOnClose="true" Modal="true" Height="390" Width="600" runat="server" OnClientClose="closeRadWindow"
EnableShadow="true" Title="Add/Edit Agreement Type">
<Windows>
<telerik:RadWindow ID="AddCompanyDialog" ShowContentDuringLoad="false" runat="server"
Title="Add Company" InitialBehaviors="Maximize" Behaviors="Close" NavigateUrl="somePage.aspx" />
</Windows>
</telerik:RadWindowManager>
function LoadCompanyPopup(sender, args) {
radopen(null, "AddCompanyDialog");
}
Actually using JavaScript is the way to work with Telerik's RadWindow. 实际上,使用JavaScript是与Telerik的RadWindow一起工作的方法。 It renders only on the client, so using it on the server is usually done by injecting scripts .
它仅在客户端上呈现,因此通常通过注入脚本在服务器上使用它。 Take a look at this thread on opening it from the server
从服务器上打开它看一下这个线程
At the original poster - take a look at these articles - opening a RadWindow from within a RadWindow on opening the second RadWindow properly (so it is not confined in the first) and at using multiple managers on the wrong URL you get - most likely you have more than one RadWindowManager on the page in which context you call radopen(). 在原始海报上-看一下这些文章- 在正确打开第二个RadWindow时从RadWindow内打开RadWindow(因此它不限于第一个),并在错误的URL上使用多个管理器 -最有可能的是在您调用radopen()的上下文页面上有多个RadWindowManager。
Use this simple Javascript code to open the window: 使用以下简单的Javascript代码打开窗口:
function LoadCompanyPopup()
{ var myWindow=window.radopen(null, "AddCompanyDialog"); }
Also, on your telerik:RadWindow tag, change your NavigateUrl attribute value from "somePage.aspx" to "./somePage.aspx" (to make sure the path to your aspx page is located). 同样,在您的telerik:RadWindow标记上,将NavigateUrl属性值从“ somePage.aspx”更改为“ ./somePage.aspx”(以确保找到aspx页面的路径)。
My memory is a bit fuzzy since it's been a few months since I had messed with Telerik controls... but something tells me it was hard/not possible to open up a window within a window using javascript. 自从我弄乱Telerik控件已经有几个月了,我的记忆有点模糊。但是有些事情告诉我,很难/不可能使用JavaScript在一个窗口中打开一个窗口。
The code I have for this scenario opens up the window with the .NET code-behind using 在这种情况下,我拥有的代码使用
radWindow.VisibleOnPageLoad = True
on a button's onClick
event 在按钮的
onClick
事件上
EDIT: 编辑:
I was mistaken! 我误解了! As rdmptn pointed out below.
正如rdmptn在下面指出的那样。 My sample javascript code for opening up a window inside a window:
我的用于在窗口内打开窗口的示例javascript代码:
function closeWin() {
GetRadWindow().close();
}
function GetRadWindow() {
var oWindow = null; if (window.radWindow)
oWindow = window.radWindow; else if (window.frameElement.radWindow)
oWindow = window.frameElement.radWindow; return oWindow;
}
function ConfirmResult(sender, args) {
var ajaxManager = $find("radAjaxManager");
ajaxManager.ajaxRequest(args._argument);
if (args._argument == "confirm")
closeWin();
}
function OpenConfirmDialog() {
var window = GetRadWindow().get_windowManager().getWindowByName("DeleteConfirmPopup");
window.show();
window.add_close(ConfirmResult);
setTimeout(function () { window.set_modal(true); }, 0);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.