我有以下代碼:.findControl()空指針異常和崩潰ASPX服務器
private Ext.Net.Store getStore(string name)
{
return (Ext.Net.Store)DUOSPage.FindControl(name);
}
和
getStore("store").DataSource = someList;
我可以確認的是, 「存儲」 對象和 「someList」 是實際上出現在頁面中。在我看來,FindControl無法找到。但是,我得到一個
someList = Count = Cannot evaluate expression because a thread is stopped at a point where garbage collection is impossible, possibly because the code is optimized.
以及本地服務器崩潰。對我來說,這意味着該元素可能在頁面中,並發現它,但它會以某種方式導致服務器畏縮和崩潰。
關於這裏有什麼問題的任何想法?爲什麼這會導致ASPX服務器崩潰?
編輯:
錯誤提示給了我這樣的:
Description:
Stopped working
Problem signature:
Problem Event Name: CLR20r3
Problem Signature 01: webdev.webserver20.exe
Problem Signature 02: 10.0.0.0
Problem Signature 03: 4ba204ca
Problem Signature 04: ****
Problem Signature 05: 1.0.0.0
Problem Signature 06: 4fe36c1c
Problem Signature 07: 3ce
Problem Signature 08: c
Problem Signature 09: System.NullReferenceException
OS Version: 6.1.7601.2.1.0.256.4
Locale ID: ****
服務器崩潰*非常奇怪* ...但是,如果FindControl返回'null',那麼在DUOSPage的*命名容器中目前沒有名爲'name' *的Control。 (它出於某種奇怪的原因被從控制樹中刪除*是「服務器端」控制嗎?) – 2012-06-21 18:56:42
當「ASPX服務器」崩潰時,會記錄哪些消息? AppPool工人是否重新啓動?掛? (YSOD /錯誤信息屏幕不是崩潰,請記住。) – 2012-06-21 18:59:38
我將錯誤輸出添加到帖子 –