2013-10-03 138 views
0

我要檢查,如果按鈕被點擊LoadViewState如何檢查LoadViewState中的按鈕是否被點擊?

代碼:

protected override void LoadViewState(object savedState) 
{ 
base.LoadViewState(savedState); 

//Here If (btnAddExperience_Click() is clicked) 
{ 
method1(); 
} 
//if(btnAddVisa_Click()) 
{ 
method2(); 
} 
} 

protected void btnAddExperience_Click(sender,e) 
{ 
    //some code 
} 

protected void btnAddVisa_Click(sender,e) 
{ 
    //some code 
} 

任何想法?

回答

0

這部作品在頁面加載,你可以嘗試在loadviewstate

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(); 
} 
+0

感謝您的迴應如何得到後回的目標是什麼? – user2500094

+0

如果它標記爲已回答;) – ufosnowcat

相關問題