2016-11-04 38 views

回答

1

只要將它作爲參數傳遞給其他類文件中的方法即可。喜歡的東西:

public class OtherClassFile 
{ 
    public static void UpdateMethod(UpdatePanel panel) 
    { 
     //Update the panel here 
    } 
} 

然後在你的.aspx頁面中的methdod呼叫是這樣的:

OtherClassFile.UpdateMethod(MyUpdatePanel); 
+0

其實我不想把它作爲參數傳遞,還有沒有其他的辦法嗎? –

+0

@DKR不是我所知道的。爲什麼你不想把它作爲參數傳遞? – Alex

+0

@這是因爲這些方法是動態創建的 –

相關問題