Need help in dynamic control data on Postback for QuestionAnswer FOrm
===

In my project i have am generating the QUestion and its Multiple Options in the following manner.

![enter image description here][1]

ASPX Page:

    <asp:Repeater runat="server" ID="repeater" DataSourceID="ods" OnItemDataBound="repeater_ItemDataBound">
            <ItemTemplate>
                <asp:Label ID="Label1" Text='<%# Eval("Question.QuestionDetail") %>'
                    runat="server" />
                <br />
                <asp:Panel runat="server" ID="panel">
                </asp:Panel>
            </ItemTemplate>
        </asp:Repeater>
        <asp:ObjectDataSource ID="ods" runat="server" SelectMethod="BindSurveyForm" TypeName="Survey.SurveyForm"
            OnSelecting="ods_Selecting">
            <SelectParameters>
                <asp:Parameter Name="SurveyId" Type="Int32" />
            </SelectParameters>
        </asp:ObjectDataSource>

CODE Side:

public IEnumerable<QuestionQuestionnaireVersion> BindSurveyForm(int SurveyId)
        {
            QuestionnaireServiceClient client = new QuestionnaireServiceClient();
            QuestionQuestionnaireVersion[] list = client.GetQuestionQuestionnaireVersionByQuestionnaireVersionId(SurveyId, "1234");
            client.Close();
            //rptSurveyQuestions.DataSource = list.ToArray();
            //rptSurveyQuestions.DataBind();
            return list;
        }

var q = e.Item.DataItem as QuestionQuestionnaireVersion;

            if (q == null)
                throw new InvalidOperationException();

            var panel = e.Item.FindControl("panel");

            if (q.QuestionVersion.Question.QuestionType.ShortCode == "MM")
            {
                var checks = new CheckBoxList { DataSource = q.QuestionVersion.QuestionOptions, DataTextField = "OptionDetail", DataValueField = "QuestionOptionId", ID = "options" + q.QuestionVersion.QuestionVersionId };
                checks.DataBind();

                panel.Controls.Add(checks);
                chkList.Add(checks);

            }
            else if (q.QuestionVersion.Question.QuestionType.ShortCode == "MS")
            {
                var radios = new RadioButtonList { DataSource = q.QuestionVersion.QuestionOptions, DataTextField = "OptionDetail", DataValueField = "QuestionOptionId" };
                radios.DataBind();

                panel.Controls.Add(radios);

            }
            else if (q.QuestionVersion.Question.QuestionType.ShortCode == "T")
            {
                var textbox = new TextBox { ID = "otheranswer" + q.QuestionVersion.QuestionVersionId };

                panel.Controls.Add(textbox);
                txtList.Add(textbox);
            }
Now i am trying to access the value of this control on the Submit Button(Button Click) but i am not able to receive it..As i know that because of the Postback the controls which are dynamically generated fails to Load.

    foreach (CheckBoxList chk in chkList)
            {
                int QuestionVersionId = Convert.ToInt32(chk.ID.Replace("options", ""));
                TextBox txtbx = (TextBox)FindControl(chk.ID);
            }
            foreach (TextBox txt in txtList)
            {
                TextBox txtbx = (TextBox)FindControl(txt.ID);
                
            }

But i need to overcome the situation so what is the Solution???

Once the Button is click i just want to get data.If the dynamically generated fields will not be loaded then its also not an issue.

So please help me out.


  [1]: http://i.stack.imgur.com/uMXmE.png