代码改变世界

文章分类 -  WebForm

WebForm 上传图片

2020-07-25 17:11 by idea555, 195 阅读, 收藏, 编辑
摘要: 前端:<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test1.aspx.cs" Inherits="WebFrom.Test1" %><!DOCTYPE html> <html xmlns="http://www.w3.org/ 阅读全文

Webform 三级联动例子

2020-07-25 16:59 by idea555, 97 阅读, 收藏, 编辑
摘要: 首先分别做三个下拉列表 <body> <form id="form1" runat="server"> <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True"></asp:DropDownList> <asp:D 阅读全文

AspNetPager 真分页

2020-07-25 16:48 by idea555, 76 阅读, 收藏, 编辑
摘要: 前台: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Test1.aspx.cs" Inherits="WebFrom.Test1" %><%@ Register Assembly="AspNetPager" Namespace= 阅读全文

JS定时器

2020-07-25 13:30 by idea555, 158 阅读, 收藏, 编辑
摘要: JS定时器: 1、window.setTimeout(function(){},3000) 延迟3秒执行 2、window.setInterval(function(){},3000) 也叫重复器,每3秒重复相同的事件 //setTimeout 1000ms后执行1次var test1 = setT 阅读全文

ajax 完整结构

2020-07-25 13:20 by idea555, 190 阅读, 收藏, 编辑
摘要: ajax完整结构: $.ajax({ url:"",//服务器路径 data:{},//给服务端传递的参数,可以没有,也可以是多个 type:"post", //传递参数的方式,可post可get dataType:"json",//数据传递的格式,有json和xml两种 success:funct 阅读全文

ashx使用session

2020-07-25 13:12 by idea555, 120 阅读, 收藏, 编辑
摘要: using System;using System.Web;using System.Web.SessionState;//第一步:引用命名空间 //第二步:实现接口public class Login : IHttpHandler, IRequiresSessionState { public v 阅读全文

ajax 与 ashx交互

2020-07-25 13:07 by idea555, 214 阅读, 收藏, 编辑
摘要: <script src="Scripts/jquery-3.3.1.min.js"></script> <script type="text/javascript"> $(function () { $.ajax({ type: "post", //提交方式 url: "/ashx/FZGpySho 阅读全文

C#-WebForm-文件上传-FileUpload控件

2020-07-25 12:28 by idea555, 753 阅读, 收藏, 编辑
摘要: FileUpload - 选择文件,不能执行上传功能,通过点击按钮实现上传 默认选择类型为所有类型 //<上传>按钮 void Button1_Click(object sender, EventArgs e) { //判断是否选中文件 if (FileUpload1.FileName.Length 阅读全文

C#-WebForm-Repeater-重复器

2020-07-25 11:23 by idea555, 189 阅读, 收藏, 编辑
摘要: Repeater-重复器 - 类似WinForm中的ListView,用列表来展示数据 格式: <body> <form id="form1" runat="server"> <asp:Repeater ID="Repeater1" runat="server"> <%-- 重复器 --%> <He 阅读全文

C#-WebForm-点击网页中的按钮后跳转到其他页面是怎么实现的?

2020-07-25 10:46 by idea555, 682 阅读, 收藏, 编辑
摘要: <!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.or 阅读全文

asp.net后台向前端输出js脚本的三种方法

2020-07-25 10:38 by idea555, 322 阅读, 收藏, 编辑
摘要: //这个方法最快,因为它会输出到html标签之前 Response.Write("<script type='text/javascript'>alert('这个最快')</script>"); //这个最慢this.ClientScript.RegisterStartupScript(this.G 阅读全文

点击文字选择简选框

2020-07-25 10:29 by idea555, 112 阅读, 收藏, 编辑
摘要: 阅读全文

如何在 input type="text" 时,文本框只能输入数字?

2020-07-25 10:27 by idea555, 403 阅读, 收藏, 编辑
摘要: <input type='text' onkeyup="(this.v=function(){this.value=this.value.replace(/[^0-9-]+/,'');}).call(this)" onblur="this.v();" />就是在失去焦点时也进行验证,因为可以用输入法 阅读全文

ASP.NET中IsPostBack详解

2020-07-25 10:12 by idea555, 253 阅读, 收藏, 编辑
摘要: 1、IsPostBack介绍Page.IsPostBack是一个标志:当前请求是否第一次打开。 调用方法为:Page.IsPostBack或者IsPostBack或者this.IsPostBack或者this.Page.IsPostBack,它们都等价。 1)当通过IE的地址栏等方式打开一个URL时 阅读全文

GridView控件+AspNetPager分页

2020-05-29 00:32 by idea555, 95 阅读, 收藏, 编辑
摘要: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="List1.aspx.cs" Inherits="WebForm.List1" %><%@ Register Assembly="AspNetPager" Namespace="Wuq 阅读全文

GridView分页

2020-05-28 21:05 by idea555, 192 阅读, 收藏, 编辑
摘要: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="List.aspx.cs" Inherits="WebForm.List" %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999 阅读全文
点击右上角即可分享
微信分享提示