ASP.NET:检查在Page_Load中单击事件 [英] ASP.NET : Check for click event in page_load

查看:168
本文介绍了ASP.NET:检查在Page_Load中单击事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在C#中,我如何检查,看是否有链接按钮被点击了页面加载的方法?

我需要知道,如果它被点击的点击触发事件之前?

解决方案

 如果(的IsPostBack)
{
    //取回后的目标,将是控制的名字
    //发出后回了
    字符串eTarget = Request.Params [__ EVENTTARGET]的ToString()。
}
 

In c#, how can I check to see if a link button has been clicked in the page load method?

I need to know if it was clicked before the click event is fired?

解决方案

if( IsPostBack ) 
{
    // get the target of the post-back, will be the name of the control
    // that issued the post-back
    string eTarget = Request.Params["__EVENTTARGET"].ToString();
}

这篇关于ASP.NET:检查在Page_Load中单击事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆