2015-10-17 82 views
1

如何从代码隐藏中显示RadWindow标题。如何从代码后面获取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> 
+0

请参阅本网站http://www.telerik.com/forums/dynamically-setting-the-title-of-a-radwindow – Sankar

回答

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将像浏览器窗口一样运行,并在Titlebar中显示该标题。为了避免这种情况,请使用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> 
0

如果你想从服务器端得到它,你可能想尝试这行代码:

string title=radcalllog.Title; 

最好的问候,

黛安