title: Parser Error Message: Could not create type 'WebService.asmx.cs'
body: <p>I am following <a href="http://www.magic-dev.com/autocomplete-search.htm" rel="nofollow">this</a> tutorial to create dynamic search results from an SQL server as a user types. It is telling me to create a .asmx file, which is not a format I have ever worked with before. I now have a .asmx and .asmx.cs file. Here is the code I have thus far :</p>
  
  <p>WebService.asmx.cs :   </p>
  
  <pre><code>public class SearchService : WebService
  {
    [WebMethod]
    public searchResult[] Search(string txtSearch)
    {
  //Declare collection of searchResult
          List resultList = new List();
          var db = Database.Open("mPlan");
          var result = db.Query("SELECT * from Users where Username like '%" + txtSearch + "%'");
         try
         {
             foreach(var record in result)
              {
                 searchResult result = new searchResult();
                 result.Username = ["Username"].ToString();
                 resultList.Add(result);
             }
             return resultList.ToArray();
         }
         catch
         {
             return null;
         }
    }}
  </code></pre>
  
  <p>WebService.asmx :</p>
  
  <pre><code>&lt;%@ WebService Language="C#" class="WebService" %&gt;
  using System;
  using System.Collections.Generic;
  using System.Web;
  using System.Web.Services;
  using System.Data.SqlClient;
  
  [System.Web.Script.Services.ScriptService]
  [System.Web.Script.Services.GenerateScriptType(typeof(searchResult))]
  public class searchResult
  {
      public string Title;
      public string img;
      public string href;
  }
  </code></pre>
  
  <p>Here is my error message, can anyone help me with this please?</p>
  
  <blockquote>
    <p>Parser Error Message: Could not create type 'WebService.asmx.cs'</p>
  </blockquote>
  
  <p>It highlights line 1 of WebService.asmx as the source of the error.</p>