Copied to clipboard

Flag this post as spam?

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


  • Robert Dolman 22 posts 42 karma points
    Apr 11, 2013 @ 14:51
    Robert Dolman
    0

    UserControls loose input values on postback v4.11.1

    I have a UserControl which I have tested in isolation & it works fine.

    When I dynamically load the control in my isolated test case it works when it's added in Page_Init.

    I can replicate Umbraco's behaviour when I load the control in Page_Load. Which is to say that all input values are lost in the code behind.

    At what point are UserControls loaded in Umbraco? Is this a bug in 4.11.1?

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Apr 11, 2013 @ 18:47
    Jan Skovgaard
    0

    Hi Robert

    Could you show some of the code?

    Is this happening on a fresh install or have it been upgraded from a previous version?

    /Jan

  • Robert Dolman 22 posts 42 karma points
    Apr 12, 2013 @ 10:20
    Robert Dolman
    0

    Code as simple as;

        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
        <asp:Button ID="Button1" runat="server" Text="Button" />
        <asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>

        protected void Page_Load(object sender, EventArgs e) {
            Label1.Text = "Text: " + TextBox1.Text;
        }

    TextBox1.Text is always String.Empty (however the textbox retains it's value in the UI element itself)

    This is an upgraded version from 4.7 upwards through most versions

Please Sign in or register to post replies

Write your reply to:

Draft