2013-10-03 4 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

감사를 시도 할 수 pageload에서 작동? 대답이 표시된대로 작동하는 경우 – user2500094

+0

;) – ufosnowcat

관련 문제