在插入时显示modalpopupextender框中现有数据的消息而不关闭modalpopupextender? 。 [英] show message for existing data at modalpopupextender box at insert time without closing modalpopupextender ? .
本文介绍了在插入时显示modalpopupextender框中现有数据的消息而不关闭modalpopupextender? 。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用modalpopupextender插入一些数据,当我插入数据时,如果它存在于数据库中然后在页面上的标签和modalpopupextender clsed中显示消息,但我想在同一个modalpopupextender中显示现有消息我在哪里插入而不关闭modalpopupextender box,plz帮帮我。
我的代码是 -
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: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>
和c#code-
and c# code-
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;
}
推荐答案
runat = server ErrorMessage = 最多允许50个字符。 >
< / td >
< / tr >
< tr >
< td > < / td >
< td > < br / > < asp:按钮 ID = btnsubmitelectivegroup onclick = btnelectivesubmit runat = server 文本 = 保存 高度 = 40px 宽度 = 80px ForeColor = 白色
< span class =code-attribute> BackColor = #123A6B / >
< asp:Button ID = btnclose runat = server 高度 = 40px < span class =code-attribute>宽度 = 80px ForeColor = 白色
BackColor = #123A6B 文字 = 关闭 CausesValidation = false / > < / td < span class =code-keyword>>
< / tr >
< / table >
< / div >
" 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>
和c#code-
and c# code-
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;
}
这篇关于在插入时显示modalpopupextender框中现有数据的消息而不关闭modalpopupextender? 。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文