一、登陆页面HTML

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication1.EasyUITest.WebForm1" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head runat="server">
  6. <title>Login</title>
  7. <script src="../Scripts/jquery-1.6.min.js" type="text/javascript"></script>
  8. <script src="../Scripts/jquery.easyui.min.js" type="text/javascript"></script>
  9. <link href="../Scripts/themes/icon.css" rel="stylesheet" type="text/css" />
  10. <link href="../Scripts/themes/default/easyui.css" rel="stylesheet" type="text/css" />
  11. <script type="text/javascript">
  12. $(function () {
  13. $("#win").window({
  14. title: "Login",
  15. width: 300,
  16. height: 200,
  17. collapsible: false,
  18. minimizable: false,
  19. maximizable: false,
  20. closable: false,
  21. closed: false,
  22. draggable: false,
  23. resizable: false,
  24. modal: true
  25. });
  26. });
  27. function login() {
  28. var name = $("#txt_name").val();
  29. var psd = $("#txt_psd").val();
  30.  
  31. $.ajax({
  32. type: "POST",
  33. dataType: "json",
  34. url: "Service/login.ashx",
  35. data: { Method: "Login" },
  36. success: function (data) {
  37. $.messager.alert("消息", data, "info");
  38. },
  39. error: function () {
  40. $.messager.alert("消息", "错误!", "info");
  41. }
  42. });
  43. }
  44. </script>
  45. </head>
  46. <body>
  47. <form id="form1" runat="server">
  48. <div id="win" class="easyui-window">
  49. <table>
  50. <tr>
  51. <td>
  52. Name:
  53. </td>
  54. <td>
  55. <input id="txt_name" type="text" />
  56. </td>
  57. </tr>
  58. <tr>
  59. <td>
  60. Password:
  61. </td>
  62. <td>
  63. <input id="txt_psd" type="text" />
  64. </td>
  65. </tr>
  66. <tr>
  67. <td>
  68. <a href="#" class="easyui-linkbutton" iconcls="icon-ok" onclick="login()">Login</a>
  69. </td>
  70. <td>
  71. <a href="#" class="easyui-linkbutton" iconcls="icon-cancel">Cancel</a>
  72. </td>
  73. </tr>
  74. </table>
  75. </div>
  76. </form>
  77. </body>
  78. </html>

二、一般处理程序

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Reflection;
  6. using System.Web.SessionState;
  7. using Newtonsoft.Json;
  8.  
  9. namespace WebApplication1.EasyUITest.Service
  10. {
  11. /// <summary>
  12. /// login 的摘要说明
  13. /// </summary>
  14. public class login : IHttpHandler, IRequiresSessionState
  15. {
  16. HttpRequest Request;
  17. HttpResponse Response;
  18. HttpSessionState Session;
  19. HttpServerUtility Server;
  20. //HttpCookie Cookie;
  21.  
  22. public void ProcessRequest(HttpContext context)
  23. {
  24. //不让浏览器缓存
  25. context.Response.Buffer = true;
  26. context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-);
  27. context.Response.AddHeader("pragma", "no-cache");
  28. context.Response.AddHeader("cache-control", "");
  29. context.Response.CacheControl = "no-cache";
  30. context.Response.ContentType = "text/plain";
  31.  
  32. Request = context.Request;
  33. Response = context.Response;
  34. Session = context.Session;
  35. Server = context.Server;
  36.  
  37. string method = Request["Method"].ToString();
  38. MethodInfo methodInfo = this.GetType().GetMethod(method);
  39. methodInfo.Invoke(this, null);
  40. }
  41.  
  42. public void Login()
  43. {
  44. Response.Write(JsonConvert.SerializeObject(DateTime.Now.ToString()));
  45. }
  46.  
  47. [Serializable]
  48. public class Infomation
  49. {
  50. public string id { get; set; }
  51. public string msg { get; set; }
  52. }
  53.  
  54. public bool IsReusable
  55. {
  56. get
  57. {
  58. return false;
  59. }
  60. }
  61. }
  62. }

三、Index页面

  1. <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="index.aspx.cs" Inherits="WebApplication1.EasyUITest.index" %>
  2.  
  3. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml">
  5. <head runat="server">
  6. <title></title>
  7. <script src="../Scripts/jquery-1.6.2.min.js" type="text/javascript"></script>
  8. <script src="../Scripts/jquery.easyui.min.js" type="text/javascript"></script>
  9. <link href="../Scripts/themes/default/easyui.css" rel="stylesheet" type="text/css" />
  10. <link href="../Scripts/themes/icon.css" rel="stylesheet" type="text/css" />
  11. <script type="text/javascript">
  12. $(function () {
  13. $("#tt").tree({
  14. checkbox: false,
  15. url: "Service/index.ashx?Method=GetTreeData&id=0",
  16. onBeforeExpand: function (node, param) {
  17. $(this).tree("options").url = "Service/index.ashx?Method=GetTreeData&id=" + node.id;
  18. },
  19. onClick: function (node) {
  20. $("#contentPage").attr("src", node.attributes);
  21. }
  22. });
  23. });
  24. function Open() {
  25. $("#contentPage").attr("src", "WebForm1.aspx");
  26. }
  27. </script>
  28. </head>
  29. <body class="easyui-layout">
  30. <div region="north" style="height: 100px;">
  31. </div>
  32. <div region="west" style="width: 200px;" title="west" split="true">
  33. <ul id="tt">
  34. </ul>
  35. </div>
  36. <div id="divCenter" region="center" title="center" style="padding: 5px; background: #eee;">
  37. <iframe id="contentPage" width="100%" height="100%" frameborder="0" marginheight="0"
  38. marginwidth="0"></iframe>
  39. </div>
  40. </body>
  41. </html>

四、Index一般处理程序

  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Web;
  5. using System.Web.SessionState;
  6. using System.Reflection;
  7. using System.Data.SqlClient;
  8. using System.Configuration;
  9. using System.Data;
  10. using System.Text;
  11.  
  12. namespace WebApplication1.EasyUITest.Service
  13. {
  14. /// <summary>
  15. /// index 的摘要说明
  16. /// </summary>
  17. public class index : IHttpHandler
  18. {
  19. HttpRequest Request;
  20. HttpResponse Response;
  21. HttpServerUtility Server;
  22. HttpSessionState Session;
  23. public readonly string connectionString = ConfigurationManager.ConnectionStrings["BookConnectionString"].ToString();
  24.  
  25. public void ProcessRequest(HttpContext context)
  26. {
  27. context.Response.Buffer = true;
  28. context.Response.ExpiresAbsolute = DateTime.Now.AddDays(-);
  29. context.Response.AddHeader("pragma", "no-cache");
  30. context.Response.AddHeader("cache-control", "");
  31. context.Response.CacheControl = "no-cache";
  32. context.Response.ContentType = "text/plain";
  33.  
  34. Request = context.Request;
  35. Response = context.Response;
  36. Session = context.Session;
  37. Server = context.Server;
  38.  
  39. string method = Request["Method"].ToString();
  40. MethodInfo methodInfo = this.GetType().GetMethod(method);
  41. methodInfo.Invoke(this, null);
  42. }
  43.  
  44. public void GetTreeData()
  45. {
  46. string id = Request.QueryString["id"].ToString();
  47. string sqlStr = "SELECT * FROM dbo.tree where parentid=" + id;
  48. DataSet ds = new DataSet();
  49. using (SqlConnection conn = new SqlConnection(connectionString))
  50. {
  51. using (SqlDataAdapter da = new SqlDataAdapter(sqlStr, conn))
  52. {
  53. da.Fill(ds);
  54. }
  55. }
  56. StringBuilder sb = new StringBuilder();
  57. sb.Append("[");
  58. ].Rows)
  59. {
  60. sb.Append("{");
  61. sb.AppendFormat("\"id\": \"{0}\", \"text\": \"{1}\", \"state\": \"closed\",\"attributes\":\"{2}\"", r["id"], r["name"], r["url"]);
  62. sb.Append("},");
  63. }
  64. sb = sb.Remove(sb.Length - , );
  65. sb.Append("]");
  66. Response.Write(sb.ToString());
  67. }
  68.  
  69. public bool IsReusable
  70. {
  71. get
  72. {
  73. return false;
  74. }
  75. }
  76. }
  77. }

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. 3D项目处理点选操作步骤

     1.用notepad++模型的obj格式文件,查找到模型各个部分的名称,命名规则:g mesh......,把名字改为规则命名.  2.选择处理 #ifdef _DEBUG #pragma comm ...

  2. Adobe Acrobat 9 Pro Extended 9.4简体中文完整免激活注册版

    Acrobat9 Pro最近升级比较频繁,如今已经升级到了Acrobat 9 Pro Extended 9.4版.亿品元素上曾经分享过Acrobat Pro Extended简体中文版 9.3.3 优 ...

  3. Silverlight第三方控件专题

    原文http://www.cnblogs.com/nasa/archive/2008/12/01/1344927.html 这里我收集整理了目前网上silverlight第三方控件的专题,若果有所遗漏 ...

  4. _extend用法总结

    针对对象数组: 后面的属性会覆盖更新前面的属性 看代码: <!DOCTYPE html> <html> <head> <meta charset=" ...

  5. 一个cocoapods问题的解决,希望能帮助到遇到相似情况的人

    之前10.7的系统上执行过cocoapods没有问题.如今系统版本号升级到了10.9,尝试使用cocoapods遇到问题,报告了类似以下的错误: Psych::SyntaxError - (/User ...

  6. css中的media

    说起CSS3的新特性,就不得不提到 Media Queries .最近 Max Design 更新的一个泛读列表里,赫然就有关于 Media Queries 的文章.同时位列其中的也有前天我刚刚翻译的 ...

  7. MySQL学习笔记(2)

    打开数据库 USE db_name; SELECT DATABASE();查看当前所选中的数据库 创建数据表 CREATA TABLE [IF NOT EXISTS] table_name ( col ...

  8. ORACLE恢复误删除的对象(表、存储过程等)

    1.恢复存储过程 原理就是利用了oracle里所有的存储过程的源代码都是存在dba_source里,而drop某个存储过程的时候,oracle这里肯定要去dba_source里把相关的源代码给dele ...

  9. 对“xxx”类型的已垃圾回收委托进行了回调。这可能会导致应用程序崩溃、损坏和数据丢失。向非托管代码传递委托时,托管应用程序必须让这些委托保持活动状态,直到确信不会再次调用它们。

    在程序中调用C++链接库中的回调函由于没有考虑生命周期,直接写委托回随机的被gc给回收掉导致报这个错误 错误的程序: private void InitPlateIdentify() { try { ...

  10. As Easy As A+B

    Problem Description These days, I am thinking about a question, how can I get a problem as easy as A ...