Code behind setting Title property on portlet fails

  1. #1

    Code behind setting Title property on portlet fails

    Hey guys,
    When i set the portlet title property from the code behind i get a JS error and the page doesn't render. but if i set the title in design mode it works great how can i programmatic ally set the title.

    Note the issue only come-in when i'm setting a title (from code behind) that looks like this "Something : Part - A"

    // Fails ON CLIENT
    NewPortlet.Title = "Something : Part - A";
    // WORKS.
    NewPortlet.Title = "Something  Part  A";
    
    <ext:Portlet ID="Portlet11" Title="Something : Part - A" runat="server" HideCollapseTool="true">
                                                                            <Tools>
                                                                                <ext:Tool Type="Search" Handler="" />
                                                                            </Tools>
                                                                    </ext:Portlet>
    Any idea how to get around this?

  2. #2

    RE: Code behind setting Title property on portlet fails

    I tried the following and it appears to work correctly.

    Example

    <%@ Page Language="C#" %>
    
    <%@ Register assembly="Coolite.Ext.Web" namespace="Coolite.Ext.Web" tagprefix="ext" %>
    
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    
    <script runat="server">
        protected void Button1_Click(object sender, AjaxEventArgs e)
        {
            this.Portlet1.Title = "Something : Part - A";
        }
    </script>
    
    <html xmlns="http://www.w3.org/1999/xhtml">
    <head runat="server">
        <title>Coolite Toolkit Examples</title>
    </head>
    <body>
        <form runat="server">
            <ext:ScriptManager runat="server" />
            
            <ext:Portal runat="server" Border="false">
                <Body>
                    <ext:ColumnLayout runat="server">
                        <ext:LayoutColumn>
                            <ext:PortalColumn runat="server">
                                <Body>
                                    <ext:AnchorLayout runat="server">
                                        <ext:Anchor>
                                            <ext:Portlet 
                                                ID="Portlet1" 
                                                runat="server" 
                                                Title="Panel 1" 
                                                BodyStyle="padding:5px;"
                                                Html="Portal 1"
                                                Height="185"
                                                Width="350">
                                                <Buttons>
                                                    <ext:Button ID="Button1" runat="server" Text="Test">
                                                        <AjaxEvents>
                                                            <Click OnEvent="Button1_Click" />
                                                        </AjaxEvents>
                                                    </ext:Button>
                                                </Buttons>    
                                            </ext:Portlet>
                                        </ext:Anchor>
                                    </ext:AnchorLayout>
                                </Body>
                            </ext:PortalColumn>
                        </ext:LayoutColumn>
                    </ext:ColumnLayout>    
                </Body>
            </ext:Portal>
        </form>
    </body>
    </html>
    Geoffrey McGill
    Founder
  3. #3

    RE: Code behind setting Title property on portlet fails

    when i am doing it is the initial load of the page and its components i notice in your example you are doing via a ajax method?
  4. #4

    RE: Code behind setting Title property on portlet fails

    Seems to work fine during the initial Page_load as well.

    Can you modify my above sample to demonstrate how to reproduce the issue. Once we're able to reproduce the issue with a full .aspx sample we can offer some more suggestions.

    Geoffrey McGill
    Founder

Similar Threads

  1. [CLOSED] Portlet bug title disappears IE8
    By moth1 in forum 1.x Legacy Premium Help
    Replies: 5
    Last Post: Jan 19, 2012, 8:15 AM
  2. [CLOSED] [1.0] ImageUrl property in Ext.Net.Portlet
    By betamax in forum 1.x Legacy Premium Help
    Replies: 2
    Last Post: Nov 03, 2010, 9:51 PM
  3. Replies: 2
    Last Post: Mar 29, 2009, 3:20 PM
  4. Need help setting the Height on Dynamic Portal/Portlet
    By iansriley in forum 1.x Legacy Premium Help
    Replies: 1
    Last Post: Mar 03, 2009, 5:38 AM
  5. setting dynamic Title to Tab panel
    By raks in forum 1.x Help
    Replies: 0
    Last Post: Feb 19, 2009, 9:04 AM

Posting Permissions