Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Christian Liebe-Harkort 56 posts 104 karma points
    Feb 01, 2013 @ 16:47
    Christian Liebe-Harkort
    0

    Behaviour of user controls have changed after upgrade to 4.11.3

    Hi,

    had some strange behaviour after upgrading to 4.11.3. in several user controls, all they have in common is that data is read on postback depending on the user selection.

    I created a very simple user control to demonstrate the problem.

    <%@ Control Language="C#" AutoEventWireup="true" CodeBehind="demo.ascx.cs" Inherits="mk.webisweb.usercontrols.demo" %>
    <asp:Literal ID="Literal1" runat="server"></asp:Literal>
    <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True">
    <asp:ListItem Selected="True" Value="1">Val1</asp:ListItem>
    <asp:ListItem Value="2">Val2</asp:ListItem>
    <asp:ListItem Value="3">Val3</asp:ListItem>
    </asp:DropDownList>

    and the code behind

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;

    namespace mk.webisweb.usercontrols
    {
        public partial class demo : System.Web.UI.UserControl
        {
            protected void Page_Load(object sender, EventArgs e)
            {
                Literal1.Text = string.Format("selected: {0}", DropDownList1.SelectedValue);
            }
        }
    }


    this control does nothing more than to show the selected value when the drop down is changed (AutoPostBack="True")

    works perfect in.
    umbraco v 4.9.1 (Assembly version: 1.0.4679.40364)

    But using this control in
    umbraco v 4.11.3 (Assembly version: 1.0.4760.34993)
    does not work anymore, the displayed value stays at 1, regardless of the selection.

    What could be the reason for that and how to fix it?

    Thanks Christian

  • Christian Liebe-Harkort 56 posts 104 karma points
    Feb 01, 2013 @ 16:56
    Christian Liebe-Harkort
    0

    I just discovered, that the user control works when I place the macro it in a template, but does not work when I allow the macro to be used in the editor and place the macro directly into the content.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 01, 2013 @ 16:56
    Jan Skovgaard
    0

    Hi Christian

    If I remember correctly some API changes was made in 4.10 - don't know if that could be the cause of this issue you're seeing perhaps. Can't remember where there was an overview about it...

    But otherwise you should perhaps try and upgrade to 4.11.4 and see if that changes anything?

    Hope this helps.

    /Jan

  • Christian Liebe-Harkort 56 posts 104 karma points
    Feb 01, 2013 @ 17:14
    Christian Liebe-Harkort
    0

    Hi Jan,

    upgraded to umbraco v 4.11.4 (Assembly version: 1.0.4780.19111) , no changes.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 11x admin c-trib
    Feb 01, 2013 @ 18:31
    Jan Skovgaard
    0

    Hi Christian

    Missed your second post before - how do you render the content from the rich text editor? Are you using Razor or Xslt? And what does the code look like?

    /Jan

  • Christian Liebe-Harkort 56 posts 104 karma points
    Feb 01, 2013 @ 19:17
    Christian Liebe-Harkort
    0

    Hi Jan,

    I simply render the content in the template e.g.


    <umbraco:item field="bodyText" runat="server" />

    I think I did not make clear, how the behaviour of the user control changed.

    In 4.11 the line

    Literal1.Text = string.Format("selected: {0}", DropDownList1.SelectedValue);
     
    always produces the same result (here 1, the value the control had when the page loaded the first time).

    I have the "feeling" it has something to do with viewstate or caching.

    Thanks
    Christian

Please Sign in or register to post replies

Write your reply to:

Draft