弹出没有AJAX和JQUERY [英] POP UP WITHOUT AJAX AND JQUERY
本文介绍了弹出没有AJAX和JQUERY的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
大家好,
i我正在开发新网站...我是新手,我的需求是
i我存储了一些价值从我的数据库到数据库......如果值存储成功,那么只有我会弹出一个按钮...如果我点击按钮我将转到主页..
请建议如何实施这些
解决方案
HI
这可能对你有帮助..
你可以自定义样式,文字等..
如果有任何问题,请回复评论:)
<%@ Page 语言 = C# EnableEven tValidation = false AutoEventWireup = true CodeBehind = WebForm2.aspx.cs
< span class =code-attribute> 继承 = POC.WebForm2 %>
< !DOCTYPE html PUBLIC - // W3C // DTD XHTML 1.0 Transitional // EN http: //www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\">
< html xmlns = http://www.w3.org/1999/xhtml >
< h ead id = Head1 runat = server >
< 样式 类型 = text / css >
。叠加
{
position : 已修复;
top : 0px;
bottom : 0px;
left : 0px;
right : 0px;
溢出 : 隐藏;
padding : 0;
margin : 0;
background-color : #000;
filter : alpha(opacity = 50);
opacity : 0.5;
z- index : 1000;
}
。 PopUpPanel
{
position : 绝对;
background-color : white;
top : 40%;
left : 30%;
z-index : 2001;
padding : 10px;
min-width : 250px;
max-width : 250px;
- moz-box-shadow : 3.5px 4px 5px#000000;
- webkit-box-shadow : 3.5px 4px 5px#000000;
box-shadow < span class =code-keyword>: 3.5px 4px 5px#000000;
border-radius : 5px;
- moz-border-radiux : 5px;
- webkit-border-radiux : 5px;
border : 3px solid green;
}
< / 样式 >
< ; script type < span class =code-keyword> = t ext / javascript >
var closepopup = < span class =code-keyword> function (){
document .getElementById(' <%= panelOverlay.ClientID%>')。style.visibility = ' hidden';
document .getElementById(' <% = panelPopUpPanel.ClientID%>')。style.visibility = ' hidden';
}
< / script >
< / head >
< ; 正文 >
< 表格 id = form1 runat = server >
< asp:按钮 ID = btnSave 文字 = 保存 runat = server OnClick = btnSave_Click / >
< 表 cellpadding = 0 cellspacing = 0 >
< tr >
< td >
< asp:面板 ID = panelOverlay 样式 = visibility:hidden runat = server class = 叠加
可见 = true >
< / asp:Panel >
< asp:Panel ID = < span class =code-keyword> panelPopUpPanel 样式 = visibility:hidden runat = server class = PopUpPanel
< span class =code-attribute> 可见 = true>
< table width = 100% >
< tr >
< < span class =code-leadattribute> td >
您的请求已成功完成,请点击继续浏览主页?
< / td >
< / tr >
< tr > ;
< td align = center >
< asp:Button ID = <跨度lass =code-keyword> btnContinue OnClientClick = window.location.href ='home.aspx'; return false;
文本 = 继续 runat = server / >
& nbsp;
< asp:Button ID = btnClose OnClientClick = self.closepopup();返回false 文本 = 关闭
runat = server / < span class =code-keyword>>
< / td >
< / tr >
< / table >
< / asp:Panel >
< / td >
< / tr >
< / table >
< / form >
< / body >
< / html >
protected void btnSave_Click( object sender,EventArgs e)
{
panelOverlay.Style.Add( visibility, visible);
panelPopUpPanel.Style.Add( visibility, 可见);
}
尝试如下。
ClientScript.RegisterStartupScript(this.GetType(),myalert,alert('你的请求已经成功完成');,true);
查看更多信息: ASP.NET Web应用程序消息框
您好,
请参阅以下链接。它会告诉你如何创建警报信息。
http://www.aspdotnet-suresh.com/2012/04/aspnet-show-alert-message-from-code.html [ ^ ]
hi all,
i am developing new website...i am new to this and my requireemnt is
i am storing some values from my from in to the datbase.....if value were stored sucesfully then only i will show the pop up with a button in it...if i cllick the button i will go to home page..
please suggest how to implememt these
解决方案
HI
This might help you..
you can customise the style, text etc..
if any issue, revert back with a comment :)
<%@ Page Language="C#" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="WebForm2.aspx.cs" Inherits="POC.WebForm2" %> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head id="Head1" runat="server"> <style type="text/css"> .Overlay { position: fixed; top: 0px; bottom: 0px; left: 0px; right: 0px; overflow: hidden; padding: 0; margin: 0; background-color: #000; filter: alpha(opacity=50); opacity: 0.5; z-index: 1000; } .PopUpPanel { position: absolute; background-color: white; top: 40%; left: 30%; z-index: 2001; padding: 10px; min-width: 250px; max-width: 250px; -moz-box-shadow: 3.5px 4px 5px #000000; -webkit-box-shadow: 3.5px 4px 5px #000000; box-shadow: 3.5px 4px 5px #000000; border-radius: 5px; -moz-border-radiux: 5px; -webkit-border-radiux: 5px; border: 3px solid green; } </style> <script type="text/javascript"> var closepopup = function () { document.getElementById('<%= panelOverlay.ClientID %>').style.visibility = 'hidden'; document.getElementById('<%= panelPopUpPanel.ClientID %>').style.visibility = 'hidden'; } </script> </head> <body> <form id="form1" runat="server"> <asp:Button ID="btnSave" Text="Save" runat="server" OnClick="btnSave_Click" /> <table cellpadding="0" cellspacing="0"> <tr> <td> <asp:Panel ID="panelOverlay" Style="visibility: hidden" runat="server" class="Overlay" Visible="true"> </asp:Panel> <asp:Panel ID="panelPopUpPanel" Style="visibility: hidden" runat="server" class="PopUpPanel" Visible="true"> <table width="100%"> <tr> <td> your request has been completed sucesfully, click continue to go home page? </td> </tr> <tr> <td align="center"> <asp:Button ID="btnContinue" OnClientClick="window.location.href = 'home.aspx'; return false;" Text="Continue" runat="server" /> <asp:Button ID="btnClose" OnClientClick="self.closepopup(); return false" Text="Close" runat="server" /> </td> </tr> </table> </asp:Panel> </td> </tr> </table> </form> </body> </html>
protected void btnSave_Click(object sender, EventArgs e) { panelOverlay.Style.Add("visibility", "visible"); panelPopUpPanel.Style.Add("visibility", "visible"); }
Try is as below.
ClientScript.RegisterStartupScript(this.GetType(), "myalert", "alert('"your request has been completed sucesfully"');", true);
Check for more info : ASP.NET Web Application Message Box
Hi,
Please see the below link. it will show you how to create alert message.
http://www.aspdotnet-suresh.com/2012/04/aspnet-show-alert-message-from-code.html[^]
这篇关于弹出没有AJAX和JQUERY的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文