<%@ Control Language="C#" AutoEventWireup="false" Inherits="AJAXControls.BaseControl" %> <% // UrlFrame.ascx // UrlFrame Control. // This control implement an iframe element that connects to the page properties. // Copyright (c) by Matthias Hertel, http://www.mathertel.de // This work is licensed under a BSD style license. See http://www.mathertel.de/License.aspx // ----- // 12.08.2005 created by Matthias Hertel // 27.09.2005 PageProperty attribute added // 19.11.2007 using the OpenAjax hub instead of PageProperties %> <script runat="server"> // define and pass parameters private string _width = null; private string _height = null; private string _eventname; public string height { get { return _height; } set { _height = value; } } public string width { get { return _width; } set { _width = value; } } public string eventname { get { return _eventname; } set { _eventname = value; } } // the default url pattern for the iframe element public string urlpattern = String.Empty; protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); base.RegisterBehavior("urlframe"); } // OnPreRender </script> <iframe id="<%=this.ClientID %>" class="UrlFrame" eventname="<%=this.eventname %>" urlpattern="<%=this.urlpattern %>" scrolling="yes" urlpattern="<%=this.urlpattern %>" style="<%= ((width != null) && (width.Length > 0)) ? "width:"+width + ";": String.Empty %> <%= ((height != null) && (height.Length > 0)) ? "height:"+height + ";" : String.Empty %>"> </iframe> <%// setup then AJAX WebPart connections for the control %> <script type="text/javascript">jcl.LoadBehaviour("<%=this.ClientID %>", jcl.UrlFrameBehaviour);</script>
This page is part of the http://www.mathertel.de/ web site.
For updates and discussions see http://ajaxaspects.blogspot.com/.