上下文不存在sender 的问题

xjl1314521wxw xjl1314521wxw 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
public void Del()
{
Button bt = sender as Button;
Button BB = bt.FindControl("Button1") as Button;
Button bt2 = sender as Button;
Label lab4 = bt.FindControl("Label4") as Label;
Session["name"] = lab4.Text;
BB.Attributes.Add("onclick", "return confirm('确定不回复" + Session["name"] + "的留言吗?')");
}
为什么我把它写在函数里面的时候它提示我上下文不存在sender,而我写在button事件里面的是完全正确的!
这个问题怎么解决?
...全文

相关推荐

评论 5
收藏 已收藏
分享
返回顶部
xjl1314521wxw
.NET社区 62,272 成员 668,968 内容