C 「 」應用程式中的伺服器錯誤

2021-07-12 03:11:11 字數 1306 閱讀 6238

asp.net mvc練手 出錯及解決全過程

1.在models檔案中新建類person.cs

public class person

public string email

public string phone

public bool? gender

} 2.新建立乙個資料夾名字叫 action, 裡面新增乙個頁面personindex.cshtml

@using (html.beginform("sendinformation", "home"))//(actionname,controllername)

,new selectlistitem ()

},"please select your gender")}

3.新增超連結到home 的index.cshtml頁面

@html.actionlink("個人資訊", "personinformation", "home", routevalues:null,htmlattributes:new )

4.在controller的homecontroller.cs中新增方法:

public string sendinformation(person person)

public actionresult personinformation()

不搜尋我的檢視中的action資料夾,根本就找不到personindex.cshtml.修改方案往下看:

方案一:將personindex.cshtml頁面挪到home資料夾中

方案二:

1,第一步沒錯,保留

2,第二步,將檢視中personindex.cshtml所在資料夾改為personaction

@using (html.beginform("sendinformation", "personaction

"))//(actionname,controllername)

,new selectlistitem ()

},"please select your gender")}

3,第三步,@html.actionlink("個人資訊", "personinformation", "personaction

", routevalues:null,htmlattributes:new )

4,第四步,在controller檔案中新增personactioncontroller.cs,將上面第四步的**挪過來,結構如下:

方案一 是名字都為home,方案二是都為personaction,我是初學者,原理我還不太懂。

哪位大哥大姐願意指教,這裡不勝感激!!!

「 」應用程式中的伺服器錯誤。

說明 執行當前 web 請求期間,出現未處理的異常。請檢查堆疊跟蹤資訊,以了解有關該錯誤以及 中導致錯誤的出處的詳細資訊。異常詳細資訊 system.io.directorynotfoundexception 未找到路徑 g 的一部分。源錯誤 執行當前 web 請求期間生成了未處理的異常。可以使用下...

「 」應用程式中的伺服器錯誤

執行時錯誤 說明 伺服器上出現應用程式錯誤。此應用程式的當前自定義錯誤設定禁止遠端檢視應用程式錯誤的詳細資訊 出於安全原因 但可以通過在本地伺服器計算機上執行的瀏覽器檢視。詳細資訊 若要使他人能夠在遠端計算機上檢視此特定錯誤資訊的詳細資訊,請在位於當前 web 應用程式根目錄下的 web.confi...

「 」應用程式中的伺服器錯誤

作業系統 windows7 64位 應用程式中的伺服器錯誤。未能載入檔案或程式集 或它的某乙個依賴項。試圖載入格式不正確的程式。說明 執行當前 web 請求期間,出現未經處理的異常。請檢查堆疊跟蹤資訊,以了解有關該錯誤以及 中導致錯誤的出處的詳細資訊。異常詳細資訊 system.badimagefo...