我Picture
類型的一個對象,它包含一個列表的評論在這裏看到源代碼http://pastebin.me/21148a93065bddb7302e160f5a0ac1fb充分利用SQL Server中的單個對象的視圖
我當時想採取Picture.ID
,並顯示具有獨特的圖像從我的數據庫ID
所以我做了我的GalleryController http://pastebin.me/21148a93065bddb7302e160f5a0acb02一個ActionResult的評論一個HTTPGET
我再有這樣的觀點,即應顯示請求的圖像,並在其列表中的評論http://pastebin.me/21148a93065bddb7302e160f5a0acb02
但我不知道如果沒有初始化它的列表,或者如果我只是做是錯誤的,但我得到一個錯誤
Server Error in '/' Application.
Object reference not set to an instance of an object.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.Exception Details:
System.NullReferenceException: Object reference not set to an instance of an object.
源錯誤:http://pastebin.me/21148a93065bddb7302e160f5a0ad965
你應該嘗試在您的文章直接發佈源的** **有關位 - 交聯到一個單獨的網站是一個有點亂,需要大量的點擊來自您的閱讀..... –
是的,但是標記該代碼的代碼往往看起來還是非常錯誤的,特別是如果它的部分/完全的HTML代碼 – Mech0z
如果您發佈的代碼,XML或數據樣本,** **請在高亮文本編輯器的線,然後單擊「代碼示例」按鈕('{}')在編輯器工具欄上進行恰當的格式化和語法突出顯示! –