title: Why showing error in Context.Response.Write()
body: <p>I'm new in ASP.Net development, and facing problem in sending data from webService to webform. I'm using JSON method,but in following line of code I'm having issue. The compiler shows this error message. </p>
  
  <blockquote>
    <p>"Error    3   Invalid token '(' in class, struct, or interface member
    declaration  </p>
  </blockquote>
  
  <p>Can someone tell me what is the problem?</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Web.Services;
  using System.Web.Script.Serialization;
  using System.Configuration;
  using System.Data.SqlClient;
  using System.Data;
  using System.Runtime.Remoting.Contexts;
  using System.Runtime.Remoting;
  
  /// &lt;summary&gt;
  /// Summary description for GetStudent
  /// &lt;/summary&gt;
  [WebService(Namespace = "http://tempuri.org/")]
  [WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
  // To allow this Web Service to be called from script, using ASP.NET AJAX, uncomment the following line. 
  [System.Web.Script.Services.ScriptService]
  public class GetStudent : System.Web.Services.WebService {
  
      [WebMethod]
      public GetStudent () {
  
          //Uncomment the following line if using designed components 
          //InitializeComponent(); 
      }
  
      [WebMethod]
      public void GetStudent () {
          SqlConnection con = new SqlConnection("Data Source=(LocalDB)\\v11.0;AttachDbFilename='C:\\Users\\Abdul Basit Mehmood\\Documents\\Visual Studio 2012\\WebSites\\WebSite1\\App_Data\\Database.mdf';Integrated Security= True");
          List&lt;StudentsList&gt; stu = new List&lt;StudentsList&gt;();
          con.Open();
          SqlCommand cmd = con.CreateCommand();
          cmd.CommandType = CommandType.Text;
          cmd.CommandText = "Select * From Student";
          SqlDataReader DR = cmd.ExecuteReader();
          while (DR.Read())
          {
              StudentsList student = new StudentsList();
              student.Id = Convert.ToInt32(DR["Id"]);
              student.name = DR["name"].ToString();
              student.fname = DR["fname"].ToString();
              student.email = DR["email"].ToString();
              student.contact = DR["contact"].ToString();
              student.Pname = DR["Pname"].ToString();
              student.Cname = DR["Cname"].ToString();
              StudentsList.Add(student);
  
          }
  
          JavaScriptSerializer js = new JavaScriptSerializer(StudentsList());
          Context.Response.Write(js.Serializ(StudentsList));
      }
  
  
  }
  </code></pre>