
asp.net代码练习 work007 ViewState[]的使用
发布日期:2021-05-06 21:17:37
浏览次数:17
分类:精选文章
本文共 1173 字,大约阅读时间需要 3 分钟。
webform1.aspx
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="work007.WebForm1" %>
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 work007{ public partial class WebForm1 : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } protected void btnSet_Click(object sender, EventArgs e) { ViewState["content"] = txtSource.Text.Trim(); } protected void btnGet_Click(object sender, EventArgs e) { if (ViewState["content"] != null) { txtResult.Text = (string)ViewState["content"]; } else { txtResult.Text = string.Empty; } } }}
发表评论
最新留言
不错!
[***.144.177.141]2025年03月21日 04时21分13秒
关于作者

喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!
推荐文章
《Java---------java环境搭建》
2019-03-04
【SSL】1072砝码称重
2019-03-04
【SSL】2294打包
2019-03-04
标程_高精度运算
2019-03-04
js数据结构--队列--常见操作
2019-03-04
JS数据结构--单向链表--常见操作
2019-03-04
【SSL】1606&【洛谷】P2014选课
2019-03-04
JS数据结构--双向链表--常见操作
2019-03-04
【SSL】1230&【洛谷】P2016战略游戏
2019-03-04
洛谷P1377树的序
2019-03-04
高阶函数-语法糖-lambda(三分钟读懂)
2019-03-04
vue的computed单向绑定(如淘宝的购物车中使用)
2019-03-04
vue双向绑定
2019-03-04
vue写自定义指令(全局或者组件内部)
2019-03-04
vue监听用户点击区域
2019-03-04
python functools模块方法
2019-03-04
python os库
2019-03-04
调度算法的一些评价指标
2019-03-04
自学js第六天:JS数组和算法
2019-03-04
同步时序逻辑电路分析
2019-03-04