Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/asp.net/29.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/jquery-ui/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# ASPX文件中的引用与ASPX.CS文件中的引用不一样_C#_Asp.net - Fatal编程技术网

C# ASPX文件中的引用与ASPX.CS文件中的引用不一样

C# ASPX文件中的引用与ASPX.CS文件中的引用不一样,c#,asp.net,C#,Asp.net,我正在使用.NET的谷歌API 我将DLL文件引用添加到项目中,并使用Google.API.Search使用对其进行寻址Search.aspx.cs文件,它可以完全正常工作 using Google.API.Search; namespace ASP._8 { public partial class Search : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e

我正在使用.NET的谷歌API

我将DLL文件引用添加到项目中,并使用Google.API.Search使用
对其进行寻址
Search.aspx.cs
文件,它可以完全正常工作

using Google.API.Search;

namespace ASP._8
{
    public partial class Search : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        public static IList<IWebResult> Search()
        {
            GwebSearchClient client = new GwebSearchClient(@"http://www.google.com/");
            IList<IWebResult> results = client.Search("Google API for .NET", 32);
            return results;
        }
    }
}
有什么想法吗?附加
Search.aspx

<%  using Google.API.Search;
    foreach (IWebResult a in ASP._8.Search.Search()){ %>

尝试添加:

<%@import Namespace="Google.API.Search" %>

就在下面
<%@import Namespace="Google.API.Search" %>