Click here to Skip to main content
15,898,134 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
i am using modalpopupextender for insert some data when i am inserting data and if that exists in database then show message in a label on page and modalpopupextender clsed ,but i want to show existing message within same modalpopupextender where i am inserting without closing modalpopupextender box ,plz help me .

my code is -
ASP.NET
<asp:Label ID="lblsubjectmassageshow" runat="server" Text="" CssClass="lblsubjectmassage"  Visible="false">
<cc1:modalpopupextender ID="mp1"  runat="server" PopupControlID="popUpPanel" TargetControlID="LinkButton5"
    CancelControlID="btnclose" BackgroundCssClass="modalBackground">

        <asp:Panel ID="popUpPanel" runat="server">
        <div id="loginform" style="border: Solid 3px #123a6b;<br mode=" hold=" /> width: 100%; height: 140px">
                cellpadding="0" cellspacing="0">
        <table>
        <tr>
              <td class="redstar"> </td>
                    <td style="background-color: #123a6b" colspan="1" hold=" />font-weight: bold; font-size: larger">
                        align="center">
                     <span style="color:White"> Add elective group</span>
                    </td>
                </tr>
        <tr>
            <td><span class="txt"><span class="textcolorarkblack">
            <br />
          Name:</span> </span><span class="redstar">*</span></td>
            <td>  <br /><asp:TextBox ID="txtelectivename"  runat="server" placeholder=" Name"
                    Width="186px">
                <asp:RequiredFieldValidator ID="rfvUserName" runat="server"
                    ErrorMessage="Please enter  User Name" ControlToValidate="txtelectivename"
                    Display="Dynamic" ForeColor="Red">
            <asp:RegularExpressionValidator Display = "Dynamic"  ControlToValidate = "txtelectivename" ForeColor="Red"  ID="RegularExpressionValidator1" ValidationExpression = "^[\s\S]{0,50}$" runat="server" ErrorMessage="Maximum 50 characters allowed.">

                    </td>
        </tr>
        
        <tr>
            <td></td>
            
            
            <td><br /><asp:Button ID="btnsubmitelectivegroup" onclick="btnelectivesubmit" runat="server" Text="Save" Height="40px" Width="80px" ForeColor="White"  
                     BackColor="#123A6B"  />
          <asp:Button ID="btnclose" runat="server" Height="40px" Width="80px" ForeColor="White"  
                     BackColor="#123A6B"  Text="Close" CausesValidation="false" /></td>
        </tr>
       
        </table>
        </div>



and c# code-
C#
protected void btnelectivesubmit(object sender, EventArgs e)
{
 InsertElectGroupwithBatchId electivegroup = new InsertElectGroupwithBatchId();
            InsertElectivegroupBatchIddInput electivegroupinput = new InsertElectivegroupBatchIddInput();
            checkExistingDatawhileinsertigOutput checkoutput = new checkExistingDatawhileinsertigOutput();
            electivegroupinput.Name = dropdownbatch.SelectedItem.Text;
            electivegroupinput.Elective_Name = txtelectivename.Text.ToString().Trim();
            electivegroup.Execute(electivegroupinput);
            //checkoutput = 
            electivegroup.Execute(electivegroupinput);
            lblsubjectmassageshow.Text = "Elective group successfully created";
           // lblsubjectmassageshow.Text = checkoutput.message;
            lblsubjectmassageshow.Visible = true;
}
Posted
v3

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900