首页 > 代码库 > 2,简单交互对话框
2,简单交互对话框
-----后台
using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Web.UI; using System.Web.UI.WebControls; public partial class _2_简单交互对话框_Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void Button1_Click(object sender, EventArgs e) { ShowDialog("删除成功"); } /// <summary> /// 弹出模式1(服务端按钮) /// </summary> /// <param name="msg">弹出的内容(必填)</param> /// <param name="asyn">true则为ajax模式(选填)</param> /// <param name="key">key值(选填)</param> public void ShowDialog(string msg,string icon="", bool asyn = false, string key = "") { string dialog = string.Format("art.dialog.alert(‘{0}‘,‘{1}‘)", msg, icon); if (!asyn) ClientScript.RegisterStartupScript(this.GetType(), key, dialog, true); else ScriptManager.RegisterClientScriptBlock(this.Page, typeof(string), key, dialog, true); } }
-----前台
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_2_简单交互对话框_Default" %> <!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 runat="server"> <title></title> <style> body { font-size:75%; color:#666; font-family:‘Microsoft Yahei‘, Tahoma, Arial!important; font-family:‘宋体‘, Tahoma, Arial;} </style> <script src="http://www.mamicode.com/artDialog/jquery-1.4.2.min.js" type="text/javascript"></script> <script src="http://www.mamicode.com/artDialog/artDialog.js?skin=default"></script> <script src="http://www.mamicode.com/artDialog/ZD.artDialog.js" type="text/javascript"></script> <script src="http://www.mamicode.com/artDialog/plugins/iframeTools.source.js" type="text/javascript"></script> <script type="text/javascript"> function dome1() { art.dialog.alert(‘人品越来越不那么稳定了,请检查!‘, "warning"); } function dome2() { art.dialog.confirm(‘你确定要删除这掉消息吗?‘, function () { art.dialog.tips(‘执行确定操作‘); }, function () { art.dialog.tips(‘执行取消操作‘); }, "succeed"); } function dome3() { art.dialog.prompt(‘请输入图片网址‘, function (val) { art.dialog.tips(val); }, ‘http://‘); } function dome4() { art.dialog.tips(‘数据正在提交..‘, 2); art.dialog.tips(‘成功!已经保存在服务器‘); } </script> </head> <body> <form id="form1" runat="server"> <input type="button" value="http://www.mamicode.com/案例1" onclick="dome1()" /> <input type="button" value="http://www.mamicode.com/案例2" onclick="dome2()" /> <input type="button" value="http://www.mamicode.com/案例3" onclick="dome3()" /> <input type="button" value="http://www.mamicode.com/案例4" onclick="dome4()" /> <br /> <asp:Button ID="Button1" runat="server" Text="服务端按钮" OnClick="Button1_Click" /> </form> </body> </html>
----dome1
----dome2
----dome3
----dome4
----服务器按钮
源代码下载地址:http://down.51cto.com/data/1968050
技术学习群(发展中,群成员免费提供资源。欢迎大家加入):426634651
本文出自 “程序猿的家--Hunter” 博客,请务必保留此出处http://962410314.blog.51cto.com/7563109/1597272
2,简单交互对话框
声明:以上内容来自用户投稿及互联网公开渠道收集整理发布,本网站不拥有所有权,未作人工编辑处理,也不承担相关法律责任,若内容有误或涉及侵权可进行投诉: 投诉/举报 工作人员会在5个工作日内联系你,一经查实,本站将立刻删除涉嫌侵权内容。