More in this section

Forums / General Discussions / Custom Control Not Posting Back

Custom Control Not Posting Back

2 posts, 0 answered
  1. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    17 Feb 2012
    Link to this post
    I have a user control:
    <div id="bug-wrapper">
        <h1>
            Report an Issue</h1>
        <div id="bug-note">
            Note: The information you provide will automatically be emailed to the appropriate
            person.
        </div>
        <div id="bug-form">
            <asp:Label ID="courseLbl" ClientIDMode="Static" runat="server" Text="Course:" CssClass="reportBugLabel" />
            <br />
            <asp:DropDownList ID="ddlCourse" ClientIDMode="Static" runat="server" OnSelectedIndexChanged="ddlCourse_SelectedIndexChanged"
                AutoPostBack="True" />
            <br />
            <asp:Label ID="lessonLbl" ClientIDMode="Static" runat="server" Text="Lesson:" CssClass="reportBugLabel" />
            <br />
            <asp:DropDownList ID="ddlLesson" ClientIDMode="Static" runat="server" Enabled="False" OnSelectedIndexChanged="ddlLesson_SelectedIndexChanged"
                AutoPostBack="True" />
            <br />
            <asp:Label ID="componenetLbl" ClientIDMode="Static" runat="server" Text="Component:" CssClass="reportBugLabel" />
            <br />
            <asp:DropDownList ID="ddlComponent" ClientIDMode="Static" runat="server" Enabled="False" />
            <br />
            <asp:Label runat="server" ClientIDMode="Static" Text="Email Address:" ID="emailLbl" CssClass="reportBugLabel" />
            <br />
            <asp:TextBox runat="server" ID="email" ClientIDMode="Static" Width="300px" />
            <br />
            <asp:Label ID="subjectLbl" ClientIDMode="Static" runat="server" Text="Subject:" CssClass="reportBugLabel" />
            <br />
            <asp:TextBox ID="subject" ClientIDMode="Static" runat="server" Width="300px"></asp:TextBox>
            <br />
            <asp:Label ID="detailsLbl" ClientIDMode="Static" runat="server" Text="Issue Details:" CssClass="reportBugLabel" />
            <br />
            <asp:TextBox ID="details" ClientIDMode="Static" runat="server" TextMode="MultiLine" Rows="10" Width="500px" />
            <br />
            <asp:Label ID="errorLbl" ClientIDMode="Static" runat="server" Text="" />
            <br />
            <asp:Button ID="SendMail" runat="server" OnClick="SendMail_Click" Text="Send" CssClass="reportBug-button" />  
            <asp:Label ID="sentLbl" ClientIDMode="Static" runat="server" Text="" />
        </div>
    </div>

    The content of ddlLesson is dynamically generated based on the selection of ddlCourse, and the content of ddlComponent is dynamically generated based on the selection of ddlLesson. The OnSelectedIndexChanged calls handle the dynamic generation, and those are ASP.NET/C# functions.

    I'm now trying to make this a custom control, and when I drop it in to a Sitefinity page it ceases working. I'm thinking that there's a special way I need to wire things now, but I'm not sure how I would go about doing that.

    The plan is to use a custom master page to put this on.

    Any help would be greatly appreciated.

    Thanks,
    Chris
  2. Chris
    Chris avatar
    37 posts
    Registered:
    18 Jan 2012
    17 Feb 2012
    Link to this post
    Never mind... figured it out. Needed to add EnablePageState directives to the master page.

    Thanks,
    Chris
2 posts, 0 answered