【问题标题】:Telerik window not loading on first click attempt of an asp linkbuttonTelerik 窗口在第一次单击 asp 链接按钮时未加载
【发布时间】:2015-12-15 05:59:30
【问题描述】:

问题:单击 asp 链接按钮时不会打开 Telerik 窗口,然后按预期加载。问题仅在第一次单击时发生。以下是代码:

  1. Manage.aspx [调用 Add_Click 的 Asp 链接按钮]
`<asp:LinkButton ID="lnkBtnAddRole" runat="server" OnClick="Add_Click"></asp:LinkButton>`
  1. Manage.aspx.cs [Add_Click 方法从后面的代码调用 Telerik 窗口]
 protected void Add_Click(object sender, EventArgs e)
{
ScriptManager.RegisterStartupScript(this, this.GetType(), "Load", "openRadWindow('../Admin/ConfigForm.aspx', 'TelRadWindowVersion1');", true);
}
  1. Manage.aspx [具有适当属性的 Telerik 窗口]
 <telerik:RadWindow ID="TelRadWindowVersion1" AutoSize="false" runat="server" VisibleStatusbar="false"
                Modal="true" Behaviors="Close, Resize" ReloadOnShow="true" CenterIfModal="true" Height="490"
                Width="700" OnClientClose="myfunc" />
  1. OnClientClose 将调用以下命令:-
 <script>       
        function myfunc() {
            <%= Page.ClientScript.GetPostBackEventReference(listRefresh, String.Empty) %>;
            window["<%= updnlist.ClientID %>"].submit;
        }
</script>

提前致谢

【问题讨论】:

    标签: asp.net telerik telerik-grid


    【解决方案1】:
    1. 确保您的 openRadWindow 函数在您每次需要时都被实际调用

    2. 确保您正在使用 Sys.Application.Load 事件来执行您的脚本,这样它就不会执行得太早

    3. 确保您通过 $find() 获得对所需对象的正确引用

    【讨论】:

    • 感谢您的快速回复,一定会尝试上述方法。
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-09-09
    • 2014-02-19
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多