
asp.net4.5练习~test4-2
发布日期:2021-05-06 21:15:26
浏览次数:14
分类:原创文章
本文共 1444 字,大约阅读时间需要 4 分钟。
webform1.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="test4_2.WebForm1" %><!DOCTYPE html><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title></title></head><body> <form id="form1" runat="server"> <div> 用户名:<asp:TextBox ID="txtName" runat="server" AutoPostBack="True" OnTextChanged="txtName_TextChanged"></asp:TextBox> <asp:Label ID="lblValidate" runat="server"></asp:Label><br /> 密码:<asp:TextBox ID="txtPassword" runat="server" TextMode="Password"></asp:TextBox><br /> E-mail:<asp:TextBox ID="txtMail" runat="server" TextMode="Email"></asp:TextBox><br /> <asp:Button ID="btnSubmit" runat="server" Text="确认" /> </div> </form></body></html>
webform1.aspx.cs
using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.UI;using System.Web.UI.WebControls;namespace test4_2{ public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { txtName.Focus(); } protected void txtName_TextChanged(object sender, EventArgs e) { if (txtName.Text == "admin") { lblValidate.Text = "此用户已存在"; } else { lblValidate.Text = "用户名可用"; } } }}
发表评论
最新留言
路过按个爪印,很不错,赞一个!
[***.219.124.196]2025年04月05日 07时52分39秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
Docker教程(二)——Docker的安装及配置加速器
2019-03-04
MyBatis(二)——MyBatis入门实例
2019-03-04
mysql常用函数
2019-03-04
Redis 缓存击穿
2019-03-04
从零带你学习Go语言:21、 Go关键词goroutine和channel
2019-03-04
从零带你学习Go语言:23、 Go指针 、切片、 map、 结构体复习
2019-03-04
从零带你学习Go语言:22、 Go基础 、包、变量和函数、流程控制语句复习
2019-03-04
从零带你学习Go语言:25、 Go并发机制
2019-03-04
【C++系列】C++中的基础语法总结
2019-03-04
广东iOS企业开发者签名有没有好的推荐?
2019-03-04
iOS企业签名掉签会提前知道的么?
2019-03-04
苹果企业签名首要考虑的真的是价格因素么?别傻了
2019-03-04
看过来!iOS签名过程中教你怎么样防止被骗?
2019-03-04
深度!苹果企业签名掉签的真正原因
2019-03-04
关于scanf函数在VS中使用的问题
2019-03-04
操作符初识
2019-03-04
C语言 - 计算n的阶乘(n!)
2019-03-04