如何从代码中获取telerik radwindow标题?

时间:2015-10-17 05:09:22

标签: asp.net vb.net telerik

如何在代码隐藏中显示 RadWindow 标题。

asp.x

 <telerik:RadWindow ID="radcalllog" runat="server" model="true" Animation="none" Style="z-index: 100000;"
    VisibleOnPageLoad="false" Skin="Windows7" Width="600px" KeepInScreenBounds="true"
    ReloadOnShow="false" Height="450px" EnableShadow="false" Modal="true" VisibleStatusbar="false"
    VisibleTitlebar="true" Behaviors="Close,Pin" Title="CALL LOG" EnableViewState="true"></telerik:RadWindow>

2 个答案:

答案 0 :(得分:0)

要从代码隐藏中显示RadWindow,请按以下步骤操作:http://docs.telerik.com/devtools/aspnet-ajax/controls/window/troubleshooting/opening-from-the-server 基本上,注册一个脚本:

string script = "function f(){$find(\"" + RadWindow1.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
ScriptManager.RegisterStartupScript(Page, Page.GetType(), "key", script, true);

如果您在其中加载的内容页面没有自己的<title>设置,则Title属性将生效。如果有,RadWindow将表现得像浏览器窗口并在其标题栏中显示该标题。为避免这种情况,请使用OnClientPageLoad事件设置自己的标题。请注意,您需要一个自定义属性,因为它将在客户端上覆盖:

        <telerik:RadWindow runat="server" ID="rw1" myServerTitle="My title" NavigateUrl="some-page.aspx" OnClientPageLoad="OnClientPageLoad"></telerik:RadWindow>
        <script>
            function OnClientPageLoad(sender, args) {
                sender.set_title(sender.get_element().getAttribute("myServerTitle"));
            }
        </script>

答案 1 :(得分:0)

如果您想从服务器端获取它,您可能需要尝试以下代码:

string title=radcalllog.Title;

致以最诚挚的问候,

戴安