惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Google DeepMind News
Google DeepMind News
Stack Overflow Blog
Stack Overflow Blog
Hugging Face - Blog
Hugging Face - Blog
博客园_首页
T
The Blog of Author Tim Ferriss
博客园 - 叶小钗
N
Netflix TechBlog - Medium
腾讯CDC
C
Check Point Blog
P
Proofpoint News Feed
Engineering at Meta
Engineering at Meta
GbyAI
GbyAI
S
SegmentFault 最新的问题
F
Fortinet All Blogs
美团技术团队
U
Unit 42
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
博客园 - 司徒正美
F
Full Disclosure
Recorded Future
Recorded Future
D
DataBreaches.Net
博客园 - 【当耐特】
Martin Fowler
Martin Fowler
J
Java Code Geeks
I
InfoQ
Y
Y Combinator Blog
A
About on SuperTechFans
AI
AI
爱范儿
爱范儿
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
Forbes - Security
Forbes - Security
W
WeLiveSecurity
M
MIT News - Artificial intelligence
雷峰网
雷峰网
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
Simon Willison's Weblog
Simon Willison's Weblog
Schneier on Security
Schneier on Security
The GitHub Blog
The GitHub Blog
Security Archives - TechRepublic
Security Archives - TechRepublic
aimingoo的专栏
aimingoo的专栏
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
G
GRAHAM CLULEY
Know Your Adversary
Know Your Adversary
Latest news
Latest news
Threat Intelligence Blog | Flashpoint
Threat Intelligence Blog | Flashpoint
D
Docker
Recent Commits to openclaw:main
Recent Commits to openclaw:main
量子位
V2EX - 技术
V2EX - 技术
Project Zero
Project Zero

博客园 - surprise

首次使用Ajax 一道Sql语句问题? 运用C#处理lob数据类型 (Oracle) 介绍一种Web上打印技术 Sql Server 中image类型迁移到Oracle 中Blob类型出现图片显示不出来,why????请博客们帮忙 在C#中存储Blob类型的数据, windows 2000下最多可以承受有多大容量外存???? 如何使用一个不错的图表组件WebChart(免费) 太爽了博客园有论坛了? 谁能帮我 WebChart组件的使用??? 能不能在博客园内建立一块开源区呀??? 如何在类库项目中添加配置文件?????? 中文版的hibernate pdf教程下载 用Nhibernate怎么实现数据的添加、删除、修改简单程序 介绍Nhibernate网站 俺现在碰到一些问题请大家帮忙??? 俺现在有个程序需要UTC转换为当地时间,哪位大虾会呀??? 我想问一下NHibernate的问题??? 10.1我发现一个非常好的架构NHibernate,我想和大家一起研究
大家看一下这是.net的漏洞还是程序有问题,我一时也没搞清,只知道这问题挺怪的 - surprise - 博客园
surprise · 2005-10-24 · via 博客园 - surprise
 

代码如下:

1.  WebForm1.aspx

<%@ Page language="c#" Codebehind="WebForm1.aspx.cs" AutoEventWireup="false" Inherits="WebApplication4.WebForm1" %>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN" >

<HTML>

<HEAD>

<title>WebForm1</title>

        <meta name="GENERATOR" Content="Microsoft Visual Studio .NET 7.1">

        <meta name="CODE_LANGUAGE" Content="C#">

        <meta name="vs_defaultClientScript" content="JavaScript">

        <meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">

        <script language="javascript">

        function aa()

               {

               //document.all.Label1.innerHTML="Ok";

               //alert("aa");

               document.getElementById('Button2').click();

               }

</script>

</HEAD>

<body MS_POSITIONING="GridLayout">

        <form id="Form1" method="post" runat="server">

        <FONT face="宋体">

               <asp:Label id="Label1" style="Z-INDEX: 101; LEFT: 304px; POSITION: absolute; TOP: 64px" runat="server"></asp:Label>

               <asp:Button id="Button1" style="Z-INDEX: 102; LEFT: 360px; POSITION: absolute; TOP: 136px" runat="server"

               Text="Button1"></asp:Button>

               <asp:Button id="Button2" style="Z-INDEX: 103; LEFT: 320px; POSITION: absolute; TOP: 208px" runat="server"

               Text="Button2"></asp:Button></FONT>

</form>

</body>

</HTML>

2.  WebForm1.aspx.cs

Page_Load中

private void Page_Load(object sender, System.EventArgs e)

     {

          if(!IsPostBack)

         {

              this.Button1.Attributes.Add("onclick","aa()");

         }

}

添加事件Button2

private void Button2_Click(object sender, System.EventArgs e)

{

     this.Label1.Text="Ok";

}

代码非常简单
运行结果

单击”Button1”按钮,Button2事件中添加断点如下

是能够进入Button2事件的(应该说Label1的值是”Ok”

但结果会是

不知道Label1为空,为什么有谁可以解释一下吗??
源代码: