modalpopup中的消息,单击同一个modalpopup中的按钮 [英] message in modalpopup,after clicking button which is in the same modalpopup

查看:65
本文介绍了modalpopup中的消息,单击同一个modalpopup中的按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在对modalpopup中出现的按钮点击事件进行一些操作。

现在基于该操作我想要在同一个modalpopup上显示一条消息。

我面临的问题是当我点击modalpopup上的按钮时,modalpopup消失了,所以我无法在modalpopup上显示消息。





 <  < span class =code-leadattribute> td  >  
< div align = center >
< asp:按钮 ID = btnAdd runat = < span class =code-keyword> server 文本 = 添加 CssClass = 按钮 OnClick = btnAdd_Click / >
< / div >
< asp:Panel ID = Panel1 runat = server 样式 < span class =code-keyword> = display:none CssClass = modalPopup >
< asp:Panel ID = Panel3 runat = server 样式 = cursor:move;背景颜色:灰色;
border:solid 1px Gray;颜色:黑色
>
技能
< < span class =code-leadattribute> / asp:Panel >
< div >
< 表格 >
< ; tr >
< td >
< asp:标签 ID = lblErrorMsg runat = 服务器 文字 = > < / asp:标签 >
< / td >
< / tr >
< tr >
< td >
< asp:标签 ID = lblSkillGroup runat = server 文字 = Skil lGroup CssClass = 粗体 > < < span class =code-leadattribute> / asp:Label >
< / td >
< ; td >
< asp:DropDownList ID = ddlSkillGroup runat = 服务器 CssClass = dropDownBox >
< / asp:DropDownList >
< / td >
< / tr >
< tr >
< td >
< asp:标签 ID = lblskill runat < span class =code-keyword> = server CssClass = bold 文字 = 技能: > < / asp:Label >
< / td >
< td >
< asp:TextBox ID = txtSkill runat = server CssClass = TextBox > < / asp:TextBox >
< / td >
< / tr >
< / table >
< p < span class =code-attribute> style = text-align:center; >
< asp:按钮 < span class =code-attribute> ID = OkButton runat = server 文本 = 确定 OnClick = OkButton_Click CssClass = 按钮 / >
< asp:按钮 ID = CancelButton runat = server 文本 = 取消 CssClass = 按钮 / >
< / p >
< / div >
< / asp:Panel >
< asp:ModalPopupExtender ID = < span class =code-keyword> ModalPopupExtender runat = server TargetControlID = btnAdd < span class =code-attribute>

< span class =code-attribute> PopupControlID = Panel1 BackgroundCssClass = modalBackground CancelControlID = CancelButton

< span class =code-attribute> DropShadow = true PopupDragHandleControlID = Panel3 / >
< / td >









这里我想点击坚果Okbutton后在标签lblErrorMsg上显示消息...



谢谢,

解决方案

嗨Jyothi,



我在这里看不到你的代码,但我可以看出按钮点击是关闭了modelpopup。



所以,在按钮中点击事件,设置下面的代码并检查它。



 ModalPopupExtender.Show(); 





现在,您可以使用所需的值(错误消息或成功消息)设置标签的文本属性。



如果这对你有帮助,请告诉我。



Happy Coding。!



谢谢,

Vamsi


hi,

I am doing some operation on button click event which is present in modalpopup.
Now based on that operation i want to display a message on the same modalpopup.
The problem i am facing is when i click on the button which is on modalpopup,the modalpopup disappears,so i am not able to show the message on modalpopup.


<td>
                                <div align="center">
                                    <asp:Button ID="btnAdd" runat="server" Text="Add" CssClass="Button" OnClick="btnAdd_Click" />
                                </div>
                                <asp:Panel ID="Panel1" runat="server" Style="display: none" CssClass="modalPopup">
                                    <asp:Panel ID="Panel3" runat="server" Style="cursor: move; background-color: gray;
                                        border: solid 1px Gray; color: Black">
                                        Skills
                                    </asp:Panel>
                                    <div>
                                        <table>
                                            <tr>
                                                <td>
                                                    <asp:Label ID="lblErrorMsg" runat="server" Text=""></asp:Label>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <asp:Label ID="lblSkillGroup" runat="server" Text="SkillGroup" CssClass="bold"></asp:Label>
                                                </td>
                                                <td>
                                                    <asp:DropDownList ID="ddlSkillGroup" runat="server" CssClass="dropDownBox">
                                                    </asp:DropDownList>
                                                </td>
                                            </tr>
                                            <tr>
                                                <td>
                                                    <asp:Label ID="lblskill" runat="server" CssClass="bold" Text="Skills:"></asp:Label>
                                                </td>
                                                <td>
                                                    <asp:TextBox ID="txtSkill" runat="server" CssClass="TextBox"></asp:TextBox>
                                                </td>
                                            </tr>
                                        </table>
                                        <p style="text-align: center;">
                                            <asp:Button ID="OkButton" runat="server" Text="OK" OnClick="OkButton_Click" CssClass="Button" />
                                            <asp:Button ID="CancelButton" runat="server" Text="Cancel" CssClass="Button" />
                                        </p>
                                    </div>
                                </asp:Panel>
                                <asp:ModalPopupExtender ID="ModalPopupExtender" runat="server" TargetControlID="btnAdd"

                                    PopupControlID="Panel1" BackgroundCssClass="modalBackground" CancelControlID="CancelButton"

                                    DropShadow="true" PopupDragHandleControlID="Panel3" />
                            </td>





here i want to display message on label "lblErrorMsg" after clicking nutton "OkButton"...

thanks,

解决方案

Hi Jyothi,

I dont see your code behind here but I can figure out that the button click is closing the modelpopup.

So, in the button click event, set the below code and check it.

ModalPopupExtender.Show();



Now, you can set the label''s text property with the required value (either error msg or success msg).

Let me know if this helped you or not.!

Happy Coding.!

Thank you,
Vamsi


这篇关于modalpopup中的消息,单击同一个modalpopup中的按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆