一、登陆页面HTML

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.EasyUITest.WebForm1" %>

<!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>Login</title>
    <script src="../Scripts/jquery-1.6.min.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.easyui.min.js" type="text/javascript"></script>
    <link href="../Scripts/themes/icon.css" rel="stylesheet" type="text/css" />
    <link href="../Scripts/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(function () {
            $("#win").window({
                title: "Login",
                width: 300,
                height: 200,
                collapsible: false,
                minimizable: false,
                maximizable: false,
                closable: false,
                closed: false,
                draggable: false,
                resizable: false,
                modal: true
            });
        });
        function login() {
            var name = $("#txt_name").val();
            var psd = $("#txt_psd").val();

            $.ajax({
                type: "POST",
                dataType: "json",
                url: "Service/login.ashx",
                data: { Method: "Login" },
                success: function (data) {
                    $.messager.alert("消息", data, "info");
                },
                error: function () {
                    $.messager.alert("消息", "错误!", "info");
                }
            });
        }
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <div id="win" class="easyui-window">
        <table>
            <tr>
                <td>
                    Name:
                </td>
                <td>
                    <input id="txt_name" type="text" />
                </td>
            </tr>
            <tr>
                <td>
                    Password:
                </td>
                <td>
                    <input id="txt_psd" type="text" />
                </td>
            </tr>
            <tr>
                <td>
                    <a href="#" class="easyui-linkbutton" iconcls="icon-ok" onclick="login()">Login</a>
                </td>
                <td>
                    <a href="#" class="easyui-linkbutton" iconcls="icon-cancel">Cancel</a>
                </td>
            </tr>
        </table>
    </div>
    </form>
</body>
</html>

二、一般处理程序

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Reflection;
using System.Web.SessionState;
using Newtonsoft.Json;

namespace WebApplication1.EasyUITest.Service
{
    /// <summary>
    /// login 的摘要说明
    /// </summary>
    public class login : IHttpHandler, IRequiresSessionState
    {
        HttpRequest Request;
        HttpResponse Response;
        HttpSessionState Session;
        HttpServerUtility Server;
        //HttpCookie Cookie;

        public void ProcessRequest(HttpContext context)
        {
            //不让浏览器缓存
            context.Response.Buffer = true;
            context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-);
            context.Response.AddHeader("pragma", "no-cache");
            context.Response.AddHeader("cache-control", "");
            context.Response.CacheControl = "no-cache";
            context.Response.ContentType = "text/plain";

            Request = context.Request;
            Response = context.Response;
            Session = context.Session;
            Server = context.Server;

            string method = Request["Method"].ToString();
            MethodInfo methodInfo = this.GetType().GetMethod(method);
            methodInfo.Invoke(this, null);
        }

        public void Login()
        {
            Response.Write(JsonConvert.SerializeObject(DateTime.Now.ToString()));
        }

        [Serializable]
        public class Infomation
        {
            public string id { get; set; }
            public string msg { get; set; }
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}

三、Index页面

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="WebApplication1.EasyUITest.index" %>

<!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>
    <script src="../Scripts/jquery-1.6.2.min.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.easyui.min.js" type="text/javascript"></script>
    <link href="../Scripts/themes/default/easyui.css" rel="stylesheet" type="text/css" />
    <link href="../Scripts/themes/icon.css" rel="stylesheet" type="text/css" />
    <script type="text/javascript">
        $(function () {
            $("#tt").tree({
                checkbox: false,
                url: "Service/index.ashx?Method=GetTreeData&id=0",
                onBeforeExpand: function (node, param) {
                    $(this).tree("options").url = "Service/index.ashx?Method=GetTreeData&id=" + node.id;
                },
                onClick: function (node) {
                    $("#contentPage").attr("src", node.attributes);
                }
            });
        });
        function Open() {
            $("#contentPage").attr("src", "WebForm1.aspx");
        }
    </script>
</head>
<body class="easyui-layout">
    <div region="north" style="height: 100px;">
    </div>
    <div region="west" style="width: 200px;" title="west" split="true">
        <ul id="tt">
        </ul>
    </div>
    <div id="divCenter" region="center" title="center" style="padding: 5px; background: #eee;">
        <iframe id="contentPage" width="100%" height="100%" frameborder="0" marginheight="0"
            marginwidth="0"></iframe>
    </div>
</body>
</html>

四、Index一般处理程序

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.SessionState;
using System.Reflection;
using System.Data.SqlClient;
using System.Configuration;
using System.Data;
using System.Text;

namespace WebApplication1.EasyUITest.Service
{
    /// <summary>
    /// index 的摘要说明
    /// </summary>
    public class index : IHttpHandler
    {
        HttpRequest Request;
        HttpResponse Response;
        HttpServerUtility Server;
        HttpSessionState Session;
        public readonly string connectionString = ConfigurationManager.ConnectionStrings["BookConnectionString"].ToString();

        public void ProcessRequest(HttpContext context)
        {
            context.Response.Buffer = true;
            context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-);
            context.Response.AddHeader("pragma", "no-cache");
            context.Response.AddHeader("cache-control", "");
            context.Response.CacheControl = "no-cache";
            context.Response.ContentType = "text/plain";

            Request = context.Request;
            Response = context.Response;
            Session = context.Session;
            Server = context.Server;

            string method = Request["Method"].ToString();
            MethodInfo methodInfo = this.GetType().GetMethod(method);
            methodInfo.Invoke(this, null);
        }

        public void GetTreeData()
        {
            string id = Request.QueryString["id"].ToString();
            string sqlStr = "SELECT * FROM dbo.tree where parentid=" + id;
            DataSet ds = new DataSet();
            using (SqlConnection conn = new SqlConnection(connectionString))
            {
                using (SqlDataAdapter da = new SqlDataAdapter(sqlStr, conn))
                {
                    da.Fill(ds);
                }
            }
            StringBuilder sb = new StringBuilder();
            sb.Append("[");
            ].Rows)
            {
                sb.Append("{");
                sb.AppendFormat("\"id\": \"{0}\", \"text\": \"{1}\", \"state\": \"closed\",\"attributes\":\"{2}\"", r["id"], r["name"], r["url"]);
                sb.Append("},");
            }
            sb = sb.Remove(sb.Length - , );
            sb.Append("]");
            Response.Write(sb.ToString());
        }

        public bool IsReusable
        {
            get
            {
                return false;
            }
        }
    }
}

Easyui登陆页面制作的更多相关文章

  1. CSS——制作天天生鲜登陆页面

    这个登陆页面主要是有一个form表单,其他的和首页差不多的. login.html: <!DOCTYPE html> <html lang="en"> &l ...

  2. MUI APP防止登陆页面出现白屏

    最近在用MUI开发APP,总体效果,在IOS上,是完美的,但是在低端的Android手机上,就会出现性能问题,我个人觉得最严重的是,就是首页,就是APP打开的第一个页面,在iOS上,由于性能高,所以, ...

  3. Android笔记-4-实现登陆页面并跳转和简单的注册页面

    实现登陆页面并跳转和简单的注册页面   首先我们来看看布局的xml代码 login.xml <span style="font-family:Arial;font-size:18px; ...

  4. Wordpress在主题中自定义登陆页面并且禁用自带的登陆页面

    在使用Wordpress制作主题之后,不想要他自带的登陆页面以及地址. 1.新建一个用户页面来接管与登陆相关的动作 //在主题根目录下新建page-login.php,通过action获取用户动作,然 ...

  5. 【Bootstrap】一个PC、平板、手机同一时候使用并且美观的登陆页面

    Bootstrap如同前台框架,它已经布置好不少的CSS.前端开发的使用须要则直接调用就可以.其站点的网址就是http://www.bootcss.com.使用Bootstrap能降低前端开发时候在C ...

  6. 小KING教你做android项目(二)---实现登陆页面并跳转和简单的注册页面

    原文:http://blog.csdn.net/jkingcl/article/details/10989773       今天我们主要来介绍登陆页面的实现,主要讲解的就是涉及到的布局,以及简单的跳 ...

  7. Springsecurity3.1.3配置多个登陆页面

    需求:网站的前台和后台不同的url需要不同的登陆页面,不同的异常捕获方式. spring-security3.1以后的版本支持多个<http>标签,因此本文所采用的方式就是使用两个,实际上 ...

  8. 页面制作部分之PS切图

    页面制作部分之PS切图 <--本标签下,通过页面制作.页面架构.javascript程序设计.DOM编程艺术.产品前端架构五部分来分享总结笔记,总结笔记会陆续分享--> 网页设计在技术层面 ...

  9. web系统登陆页面增加验证码

    传统登陆页面中包含两个输入项: • 用户名 • 密码有时为了防止机器人进行自动登陆操作,或者防止恶意用户进行用户信息扫描,需增加动态验证码功能.此时,登陆页面中包含了三个输入项: • 用户名 • 密码 ...

随机推荐

  1. 编写一个程序实现strcmp函数的功能

    写自己的strcat函数------→mycmp #include <stdio.h> #include <string.h> #define N 5 int mycmp(ch ...

  2. 关于“#ifdef __cplusplus”

    CC++语言在编译的时候为了解决函数的多态问题,会将函数名和参数联合起来生成一个中间的函数名称,而C语言则不会,因此会造成链接时找不到对应函数的情况,此时C函数就需要用extern “C”进行链接指定 ...

  3. Android中pendingIntent的深入理解

    pendingIntent字面意义:等待的,未决定的Intent.要得到一个pendingIntent对象,使用方法类的静态方法 getActivity(Context, int, Intent, i ...

  4. Linux c 信号量

    信号量(通过进程通信实现进程间的同步) 信号量(semaphore)信号灯 信号量是共享内存整数数组.根据需要定义指定的数组长度 信号量就是根据数组中的值,决定阻塞还是解除阻塞 编程模型: 1.    ...

  5. 二道shell面试题

    1.按照给出的运行结果,编写一个名为xunhuan 的shell过程(用循环语句). 0 10 210 3210 43210 543210 6543210 76543210 876543210 2.编 ...

  6. C++与AS3

    ActionScript 3(简称AS3)与 c++ 都是面向对象的编程(OOP)语言,都具有OOP的特性如封装.继承.多态等.二者在语法上有许多相似之处,基本上学过C++之后再学习AS3感觉并不是特 ...

  7. android样式布局---&gt;ListView(附上源代码)

    在android应用开发过程中,Listview 是经常使用的数据展现控件,往往用于显示列表形式的数据. 假设只显示数据往往会显得非常单调.非常多时候依据须要定义不同的item 背景选项.比如定义数据 ...

  8. UCML破解

    最近一直加班,好久没更新了.无良的产品经理一直催着修改功能,本想把活带回家做..结果...公司就一个UCML的加密狗...闹心....想办法破解: 1.狗复制,这个没搞过,某宝上有帮忙复制的,联系了一 ...

  9. textarea中的空格与换行

    当在一个textarea标签中键入一个回车时,实际上会插入2个符号:\n\r在javascript里, line breaks用\n表示when you pull text into Javascri ...

  10. hdu 4033 Regular Polygon 计算几何 二分+余弦定理

    题目链接 给一个n个顶点的正多边形, 给出多边形内部一个点到n个顶点的距离, 让你求出这个多边形的边长. 二分边长, 然后用余弦定理求出给出的相邻的两个边之间的夹角, 看所有的加起来是不是2Pi. # ...