MVC中的幾個問題匯總


1.The model backing the 'XXXXDBContext' context has changed since the database was created. Either manually delete/update the database, or call Database.SetInitializer with an IDatabaseInitializer instance. For example, the DropCreateDatabaseIfModelChanges strategy will automatically delete and recreate the database, and optionally seed it with new data.

  出現上述錯誤需要在Global.asax中的Application_Start方法中加入:

Database.SetInitializer<Models.XXXXDBContext>(null);

2.<a>標簽在display:block設置下不能居中的問題。

把display:block改為display:inline-block就OK了。

3.如果用<a>標簽代替submit按鈕。

 <a href="javascript:;" onclick="javascript:document.forms[0].submit();">保存</a>

 

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM