+1-888-365-2779
Try Now
More in this section

Forums / General Discussions / Custom Module Postback DataBinding

Custom Module Postback DataBinding

3 posts, 0 answered
  1. Joseph
    Joseph avatar
    11 posts
    Registered:
    03 Aug 2010
    28 Feb 2013
    Link to this post

    Hi,

    I have created a custom intra-site module in the Sitefinity admin, which resides next to the administration tab. 

    I have a user control with a drop down list, which is populated when the page does not post back. When I click the save button:

    <asp:LinkButton ID="lnk1" runat="Server"/>

    The postback removes all of the drop down list's items. Here is my code:

    protected void Page_Load(object sender, EventArgs e)
    {
            if (!Page.IsPostBack)
            {
               LoadGLAccts("OtherAsset", ref list_ItemsAssetAcct);
           }
    }

    I have turned viewstate on in my user control. Is there a special way to bind dropdowns in custom intra-site modules?

  2. Daniel Plomp
    Daniel Plomp avatar
    952 posts
    Registered:
    18 Feb 2004
    01 Mar 2013 in reply to Joseph
    Link to this post

    Hi Joseph,

    I always put these lines in the Page_Load of such UserControls:

    Page.ViewStateMode = ViewStateMode.Enabled;
    Page.EnableViewState = true;

    Be sure that the page where this UserControl is living on, also has the ViewState property enabled. You can do this in the Page Properties from the Sitefinity backend.

    Kind regards,
    Daniel

  3. Joseph
    Joseph avatar
    11 posts
    Registered:
    03 Aug 2010
    01 Mar 2013 in reply to Daniel Plomp
    Link to this post

    Thanks. I added more details steps for my module here: http://jmawebtechnologies.com/support/quickbooks/sitefinity-quickbooks-installation

    Read website for more details.

3 posts, 0 answered