Hi Friends,
Am facing a problem in Modal popup. following is the source code

        <asp:Button runat="server" ID="hiddenTargetControlForModalPopup" Style="display: none" />
        <ajaxToolkit:ModalPopupExtender runat="server" ID="programmaticModalPopup" BehaviorID="programmaticModalPopupBehavior"
            TargetControlID="hiddenTargetControlForModalPopup" PopupControlID="programmaticPopup"
            BackgroundCssClass="modalBackground" DropShadow="True" PopupDragHandleControlID="programmaticPopupDragHandle"
        <asp:Panel runat="server" CssClass="modalPopup" ID="programmaticPopup" ScrollBars="auto"
            Height="300px" Style="display: none; width: 600px; padding: 10px">
            <div style="padding-top: 10px;">
              <asp:TextBox ID="TextBoxEdit" runat="server"></asp:TextBox>            </div>
                <a runat="server" id="EditQuestion" class="button" href="#" onserverclick="EditQuestion_Click">
                    Update</a> <a id="hideModalPopupViaClientButton" class="button" href="#">Cancel</a>
            <br />

From below code am triggering the popup and also setting the intial value of TextBoxEdit .

protected void LinkButtonQuestionEdit_Click(object sender, EventArgs e)
            LinkButton questionLink = (LinkButton)sender;
            QuestionBank question = business.GetQuestionById(int.Parse(questionLink.CommandArgument));
            TextBoxEdit.Text = question.Question;

from below code code am capturing the TextBoxEdit value but the value getting null.

protected void EditQuestion_Click(object sender, EventArgs e)
            QuestionBank question = new QuestionBank();
            question.Question = TextBoxEdit.Text;

you can find the controls in modalpopup . am getting popup and am changing the value of TextBoxEdit. but in code behind TextBoxEdit is getting null After postback.
Even if we wont change then also the TextBoxEdit value will gets null value.

Please help me.

why ajax Modal Popup. use jquery Modal popup
easy 2 use

Be a part of the DaniWeb community

We're a friendly, industry-focused community of 1.20 million developers, IT pros, digital marketers, and technology enthusiasts learning and sharing knowledge.