我使用Visual Studio 2010設計一個網頁,我已經使用了層如何在類型名稱中指定程序集顯式?
編程,我使用的是gidview和ObjectDataSource,但我得到這個exeption:
"The type 'WebApplication4.view1' is ambiguous: it could come from assembly
'C:\Users\EHSAN\AppData\Local\Temp\Temporary ASP.NET
Files\root\d04444bc\d654bde6\App_Code.i0fp6yrj.DLL' or from assembly
'C:\Users\EHSAN\Documents\Visual Studio
2010\Projects\WebApplication4\WebApplication4\bin\WebApplication4.DLL'. Please
specify the assembly explicitly in the type name."
我把我的代碼在這裏:
這是我web.aspx:
<asp:ObjectDataSource ID="ObjectDataSource1" Runat="server" TypeName="WebApplication4.view1"
SelectMethod="Search" OldValuesParameterFormatString="original_{0}" >
</asp:ObjectDataSource>
,這是在App_Code文件夾BAL的search.cs文件:
namespace WebApplication4
{
using System;
using System.Collections.Generic;
using System.Text;
using System.Linq;
using System.Data;
public class view1 : System.Web.UI.Page
{
public view1()
{ }
public List<person> Search()
{
List<person> persons = new List<person>();
DataSet ds = PersonsDB.Search();
foreach (DataRow row in ds.Tables[0].Rows)
{
persons.Add(new person((String)row["id"], (String)row["nam"], (String)row["family"], (String)row["namepedar"], (String)row["shshenas"], (String)row["codemelli"]));
}
return persons;
}
}
問題在哪裏?
感謝您的回覆,但是,我的解決方案中沒有任何其他類名爲view1! –
您是否嘗試清除臨時網絡文件? – Augusto