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

推荐订阅源

爱范儿
爱范儿
博客园_首页
W
WeLiveSecurity
S
Secure Thoughts
S
Security @ Cisco Blogs
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Hugging Face - Blog
Hugging Face - Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
H
Hacker News: Front Page
Project Zero
Project Zero
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
U
Unit 42
N
News and Events Feed by Topic
N
News and Events Feed by Topic
Hacker News - Newest:
Hacker News - Newest: "LLM"
Forbes - Security
Forbes - Security
T
Tor Project blog
I
Intezer
B
Blog
F
Full Disclosure
Security Archives - TechRepublic
Security Archives - TechRepublic
F
Fortinet All Blogs
Schneier on Security
Schneier on Security
T
Threat Research - Cisco Blogs
AI
AI
Google DeepMind News
Google DeepMind News
L
LINUX DO - 最新话题
Cloudbric
Cloudbric
L
Lohrmann on Cybersecurity
WordPress大学
WordPress大学
博客园 - 聂微东
雷峰网
雷峰网
P
Privacy International News Feed
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
PCI Perspectives
PCI Perspectives
Y
Y Combinator Blog
Spread Privacy
Spread Privacy
Simon Willison's Weblog
Simon Willison's Weblog
罗磊的独立博客
Vercel News
Vercel News
A
Arctic Wolf
The Register - Security
The Register - Security
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
Microsoft Azure Blog
Microsoft Azure Blog
H
Heimdal Security Blog
Know Your Adversary
Know Your Adversary
P
Proofpoint News Feed
C
Cybersecurity and Infrastructure Security Agency CISA
P
Proofpoint News Feed

博客园 - 使名扬

vs.net 2005 C# WinForm GroupBOX 的BUG?尝试读取或写入受保护的内存。这通常指示其他内存已损坏 windows2003双网卡安装openmeetings成功后登录页空白 access top order by的逻辑问题 解决vs2005中文乱码问题 登录失败:用户帐户限制。可能的原因包括不允许空密码,登录时间限制,或强制的策略限制。 - 使名扬 - 博客园 gridview中如何添加对某行删除时的确认提示框 DataList父子嵌套 VS2008 母版页嵌套母版页,下级母版页不执行Page_Load解决方法 - 使名扬 - 博客园 360会导致MSDN "无法显示该网页" - 使名扬 - 博客园 asp.net下使用FCKeditor 2.6.6 in ,exists ,join sql server 2000中了解各表的记录数 oracle树形sql查询 谨慎使用windows 2003 64位版 带日期,时间和闰年验证的正则式 走进非洲,发现全错了-关于sqlserver2000下全球化网站生僻语种sql查询的解决方案 MSDN上关于sqlserver 万能分页原理实现的一个致命错误 BUGReport:datagrid带模板列绑定空数据集出错的问题 Asp.net 2.0 Webpart 数据库的迁移
关于vs.net 2003向vs.net 2005迁移后,注册事件丢失,"并不包含...的定义" 的解决方法 - 使名扬
使名扬 · 2008-07-24 · via 博客园 - 使名扬

现像描述:

编译器错误信息: CS0117: “ASP.upload_aspx”并不包含“DataList1_DeleteCommand”的定义

源错误:

行 47: 		<form id="Form1" method="post" runat="server">
            行 48:             <div class="tb_title"> 案号:<%=ajbh%></div><br>
            行 49: 			<asp:DataList ID="DataList1" Runat="server" DataKeyField="pic_id" RepeatDirection="Horizontal"
            行 50: 				RepeatColumns="8" Font-Size="X-Small" CellSpacing="1" BorderWidth="1px" CellPadding="1" BorderStyle="Dashed"
            行 51: 				GridLines="Both" OnDeleteCommand="DataList1_DeleteCommand">

原因: vs.net 2003事件是在.cs里用代码加上去的,迁移后vs.net 2005后,代码没有相应的自动改过来。

/// <summary>
  /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  /// 此方法的内容。
  /// </summary>
  private void InitializeComponent()
  {   
   this.DataList1.DeleteCommand += new System.Web.UI.WebControls.DataListCommandEventHandler(this.DataList1_DeleteCommand);
   this.DataList1.ItemDataBound += new System.Web.UI.WebControls.DataListItemEventHandler(this.DataList1_ItemDataBound);

  }
  #endregion

private void DataList1_DeleteCommand(object source, System.Web.UI.WebControls.DataListCommandEventArgs e)

更新到vs.net 2005后,事件是写在aspx里的,对于丢失的事件

1.可以删掉vs.net 2003时代自动生成的那一整段。

#region Web 窗体设计器生成的代码
  override protected void OnInit(EventArgs e)
  {
   //
   // CODEGEN: 该调用是 ASP.NET Web 窗体设计器所必需的。
   //
   InitializeComponent();
   base.OnInit(e);
  }
  
  /// <summary>
  /// 设计器支持所需的方法 - 不要使用代码编辑器修改
  /// 此方法的内容。
  /// </summary>
  private void InitializeComponent()
  {   
   this.DataList1.DeleteCommand += new System.Web.UI.WebControls.DataListCommandEventHandler(this.DataList1_DeleteCommand);
   this.DataList1.ItemDataBound += new System.Web.UI.WebControls.DataListItemEventHandler(this.DataList1_ItemDataBound);

  }
  #endregion

2.在IDE中或是aspx中确定事件指定过了。

3.在cs中把private 改成protected或是public

protected void DataList1_DeleteCommand(object source, System.Web.UI.WebControls.DataListCommandEventArgs e)
  *因为只有public 和protected的可以在Aspx里使用。