今天学习mvc3遇到了两个问题,
第一:“<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">”,经过搜索,原来必须要在webconfig的<assemblies>节中添加<add assembly="System.Data.Entity, Version=4.0.0.0, Culture=neutral,PublicKeyToken=b77a5c561934e089"></add>
第二:linq的连接串说是找不到了,原来是下面这段自动生成了Model层的app.config里,解决方法就是把它剪切到网站的webconfig中
<connectionStrings>
<add name="SHOPEntities" connectionString="metadata=res://*/ShopEntity.csdl|res://*/ShopEntity.ssdl|res://*/ShopEntity.msl;provider=System.Data.SqlClient;provider connection string="Data Source=localhost;Initial Catalog=William.Shop;Integrated Security=True;MultipleActiveResultSets=True"" providerName="System.Data.EntityClient" /> </connectionStrings>看了一会js,innerHTML和innerText的区别可以从下面的代码中体现出来,
function Test() {
var countries = new Array(); countries[0] = "China"; countries[1] = "America"; countries[2] = "England"; var s = ""; var div = document.getElementById("divArrayContent"); for (var i = 0; i < countries.length; ++i) { s = s + countries[i] + "<br />"; //document.write(countries[i] + "</br>"); } //div.innerHTML = s; div.innerText = s; }