prototype 学习之简单实例
来源:互联网 发布:ios 网络加载等待界面 编辑:程序博客网 时间:2024/05/26 08:42
Default.aspx文件
- <%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_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 id="Head1" runat="server">
- <title>Untitled Page</title>
- <script type="text/javascript" src="prototype.js"></script>
- <script type="text/javascript">
- function checkUser(){
- var myAjax = new Ajax.Request(
- 'CheckUser.aspx',
- {method: 'post', parameters: 'UserName='+document.getElementById("mUserNameTextBox").value, onComplete:
- function(r){
- if(r.responseText=="0"){
- //不存在
- }else{
- //存在的话报告,并且进行相关的处理
- document.getElementById("message").innerText="已经存在";
- }
- }
- }
- );
- }
- </script>
- </head>
- <body>
- <form id="form1" runat="server">
- <div>
- 用户名:<asp:TextBox ID="mUserNameTextBox" runat="server" onblur="javascript:checkUser();"></asp:TextBox><span id="message"></span><br />
- 其他滴:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox></div>
- </form>
- </body>
- </html>
CheckUser.aspx.cs文件
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- public partial class CheckUser : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- //检验用户的逻辑
- Response.Write("1");
- Response.End();
- Response.AppendHeader("Expires", "Mon, 26 Jul 1997 05:00:00 GMT");//防止缓存
- }
- }
- prototype 学习之简单实例
- dialplan 学习之简单入门实例
- onvif学习之gsoap简单实例
- Android学习之获取 电池电量 简单实例
- AJAX之Prototype入门学习
- AJAX之Prototype入门学习
- nodejs学习笔记 之prototype
- Prototype学习笔记系列之Event.stopObserving()
- 设计模式之Prototype的学习笔记
- Prototype源码学习之trycatch妙用
- JS学习之道:JS中的prototype
- javascript学习十一:面向对象之prototype
- 学习笔记之原型模式 prototype
- vue.js学习笔记之prototype
- JavaScript之Prototype学习(一)
- JavaScript之Prototype学习(二)
- JavaScript之Prototype学习(三)
- Android学习之SQLite数据库简单测试实例
- datagridview数据导出到excel
- 收获平静,奔跑而不是飞翔
- http://www.cnblogs.com/superwulei/archive/2008/08/04/1260344.html
- xAjax 乱码的解决
- 有感于Java的学习过程,我该掌握每个细节吗?
- prototype 学习之简单实例
- C#操作ACCESS数据库(创建,压缩,备份,恢复)
- 换一种方式看奥运
- C#与存储过程
- Google 即将推出人工翻译服务平台
- 基于“云”模式的 Web 过滤服务
- C#数据库操作实例
- IIS5、IIS6、IIS7的ASP.net 请求处理过程比较
- 08.05