【发布时间】:2014-10-29 14:06:07
【问题描述】:
我是 dotnetnuke 模块开发的新手。
设置:dotnetnuke 7 + christoc 模块,telerik ajax ui 控制:Q2 版本 2。我在 DNN 中注册了一个用户控件 Patientupdate.ascx。在其中我有几个控件,即一个 radgrid (ResultaatGrid) 和一个 radwindow,也作为一个名为 COVUserControl 的用户控件(但未在 DNN 中注册)。当单击按钮时,radwindow 在 radgrid 内部以formedit 模式调用。
radwindow 代码的 sn-p(在 patientupdate.ascx 内)
在 radwindow 中,我放置了用户控件 (COVUserControl),并在用户控件中定义了一个 radgrid。
<telerik:RadWindow ID="COVWindow" Title="Editing record" Width="270"
Height="540" VisibleOnPageLoad="false" Behaviors="Resize, Minimize, Close, Pin, Maximize, Move"
Left="610" EnableShadow="true" runat="server" OnClientClose="refreshGrid" Modal="true">
<ContentTemplate>
<asp:Panel ID="Panel1" runat="server">
<COVUC:COVUserControl runat="server" ID="COVUCID"/>
</asp:Panel>
</ContentTemplate>
</telerik:RadWindow>
在编辑模板中,我有一个名为(在 patientupdate.ascx 中)的按钮,在 patientupdate.ascx.cs 后面的代码中
在 ResultaatGrid_Item 命令中,我有以下代码:
protected void ResultaatGrid_ItemCommand(object sender, GridCommandEventArgs e)
{
if (e.CommandName == "COV")
{
GridEditableItem editedItem = e.Item as GridEditableItem;
string pCperID = editedItem.GetDataKeyValue("cpersoon_id").ToString();
COVWindow.Width = 500;
COVWindow.Height = 250;
COVUserControl COVUC1 = COVWindow.ContentContainer.FindControl("COVUCID") as COVUserControl;
COVUC1.cPersoonID = pCperID;
RadGrid COVGrid = COVUC1.FindControl("COVGrid") as RadGrid;
string script = "function f(){$find(\"" + COVWindow.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
ScriptManager.RegisterStartupScript(this, this.GetType(), "key", script, true);
COVGrid.Rebind();
}
}
问题是 radwindow 没有弹出。 (我已经检查了 host -> extension-> 中的弹出窗口并检查了模块的允许弹出窗口)。
调试(附加)时,我看到 Covgrid.rebind 被触发,因为它触发了 COVUserControl 内网格的 radgrid 需要数据源。
当不是 dotnetnuke 模块时,相同的代码可以工作,即 radwindow 弹出窗口。 (只是普通的 patientupdate.aspx)。
我认为以下代码行不会触发:
string script = "function f(){$find(\"" + COVWindow.ClientID + "\").show();
Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
ScriptManager.RegisterStartupScript(this, this.GetType(), "key", script, true);
【问题讨论】:
标签: asp.net telerik dotnetnuke radwindow registerstartupscript