Copied to clipboard

Flag this post as spam?

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


  • Morten Vejhe 1 post 21 karma points
    Oct 21, 2011 @ 10:27
    Morten Vejhe
    0

    UserControl not behaving as expected

    Hi,

    I'm building a site with several .NET UserControls exposed to the front-end user, as a way to manipulate data, but I'm having some problems when the UserControls is inserted as a macro in the rich-text-editor:

    • LoadViewState is never called during postback (and all databound controls looses all DataKeyName-value etc.)
    • The Init event is never firing (when I insert the control directly in my template Init is called, but LoadViewState is not)
    • SaveViewState is invoked on every page-load (great!)
    • The outputted HTML contains a viewstate
    When I use the UserControl directly via ASP.net, with the same template (sans ~/umbraco/masterpages/default.master as MasterPage file) everything works as expected, and viewstate is preserved and loaded correctly.
    Is this the expected behaviour from Umbraco or I'm I doing something wrong?
    System info
    umbraco v 4.7.0 (Assembly version: 1.0.4090.38017)
    IIS 7 @ Windows 7 x64, running as .NET 4.0, integrated
    ASP.net 4.0
  • Dan Diplo 1505 posts 5911 karma points MVP 4x c-trib
    Oct 24, 2011 @ 10:37
    Dan Diplo
    0

    I presume Umbraco dynamically creates user controls, so could it be related to this? http://www.velocityreviews.com/forums/t360079-solution-loadviewstate-not-getting-fired-in-asp-net-2-0-a.html

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies