title: Error in asp.net c# code
body: <p>I have a webform in which i am calling a function DropDown() from a .cs file</p>
  
  <p>Reference:same as my friend ishan posted on <a href="https://stackoverflow.com/questions/4612601/calling-a-c-function-in-asp-net">Calling a C# function in asp.net</a></p>
  
  <p>I am getting the error as:</p>
  
  <blockquote>
    <p>Error 1 'DropDown' does not contain a
    definition for 'DropDown' and no
    extension method 'DropDown' accepting
    a first argument of type 'DropDown'
    could be found (are you missing a
    using directive or an assembly
    reference?)</p>
  </blockquote>
  
  <p><strong>aspx.cs code as follows:</strong></p>
  
  <pre><code>using System;
  using System.Configuration;
  using System.Data;
  using System.Linq;
  using System.Web;
  using System.Web.Security;
  using System.Web.UI;
  using System.Web.UI.HtmlControls;
  using System.Web.UI.WebControls;
  using System.Web.UI.WebControls.WebParts;
  using System.Xml.Linq;
  using System.Data.Odbc;
  using System.Data.SqlClient;
  using System.Collections;
  using System.IO;
  using iTextSharp.text.html.simpleparser;
  using iTextSharp.text;
  using iTextSharp.text.pdf;
  using iTextSharp.text.html;
  public partial class _Default : System.Web.UI.Page
  {
  
      protected void Page_Load(object sender, EventArgs e)
      {
  
      }
      protected void DropDownList2_SelectedIndexChanged(object sender, EventArgs e)
      {
          DropDown abs =new DropDown(this.DropDownList2,this.DropDownList3);
          abs.DropDown();
      }
  
      //*******On click of GO
  
      public void Button1_Click(object sender, EventArgs e)
      {
          Button4.Visible = true;
          String dbDate = DateTime.ParseExact(TextBox3.Text, "dd/mm/yyyy", null).ToString("yyyy-mm-dd");
  
  
          String respo1 = "";
          String respo2 = "";
          String editorcont1 = "";
          int res = 0;
          String sb = "";
  
          String petitioner = "";
          String petitioner1 = "";
          String resp = "";
          String resp1 = "";
  
          String respondants = "";
          String addr1 = "";
          String addr2 = "";
  
  
          var order = "";
  
          String nextdate = "";
          String nextdate1 = "**/**/****";
          String judge1 = "";
          String judge2 = "";
          String judge3 = "";
  
  
  
          String a = DropDownList1.SelectedItem.Value;
          String b = DropDownList3.SelectedItem.Value.PadLeft(3, '0');
          String c = TextBox1.Text.PadLeft(5, '0').ToString();
          String d = TextBox2.Text.ToString();
          String digit = a + b + c + d;
          String jjj = "";
  
  
          try
          {
              OdbcConnection casetype = new OdbcConnection("Driver={MySQL ODBC 3.51 Driver};Server=10.155.160.130;Database=testcase;User=root;Password=;Option=3;");
              casetype.Open();
  
              String petresquery1 = "select fil_no from testcase.main where reg_no =? OR fil_no=?";
              OdbcCommand petrescmd1 = new OdbcCommand(petresquery1, casetype);
              petrescmd1.Parameters.AddWithValue("?", digit);
              petrescmd1.Parameters.AddWithValue("?", digit);
              OdbcDataReader respetMyReader1 = petrescmd1.ExecuteReader();
  
              while (respetMyReader1.Read())
              {
                  String fil_no = respetMyReader1["fil_no"].ToString();
                  HiddenField4.Value = fil_no;
                  //Response.Write(HiddenField4.Value);
              }
  
  
  
  
  
              string showmodifquery = "select notice from notice_aspx where fil_no=?";
  
              OdbcCommand showmodifcmd = new OdbcCommand(showmodifquery, casetype);
  
              showmodifcmd.Parameters.AddWithValue("?", HiddenField4.Value);
              OdbcDataReader showmodifMyReader = showmodifcmd.ExecuteReader();
  
              if (showmodifMyReader.Read())
              {
                  String showmodif1 = showmodifMyReader["notice"].ToString();
                  Editor1.Content = showmodif1;
              }
              else
              {
                  //************to get case type     
                  string casetypequery = "select casename from casetype where skey=?";
                  //************to get pet  res
                  string petresquery = "select pet_name,res_name from testcase.main where reg_no =? OR fil_no=?";
                  //*******to get respondants 
                  string respoquery = "SELECT sr_no,partyname,addr1,addr2 FROM testcase.party where fil_no=? and pet_res='R'order by sr_no,party_lh,party_lh2,party_lh3,party_lh4,party_lh5";
                  //*******to get order
                  string ordequery = "select orde from testcase.orddetpabak where fil_no=? and orderdate=?";
                  //*********to get next date
                  string nextdatequery = "SELECT next_dt FROM testcase.heardt where fil_no=? and next_dt&gt;?;";
                  //*********to get jud1
                  string jud1query = "select jname from testcase.orddetpabak,testcase.judge where orddetpabak.jud1 = judge.jcode and fil_no=? and orderdate=?;";
                  //*********to get jud2
                  string jud2query = "select jname from testcase.orddetpabak,testcase.judge where orddetpabak.jud2 = judge.jcode and fil_no=? and orderdate=?;";
                  //*********to get jud3
                  string jud3query = "select jname from testcase.orddetpabak,testcase.judge where orddetpabak.jud3 = judge.jcode and fil_no=? and orderdate=?;";
  
                  //************to get case type 
                  OdbcCommand casetypecmd = new OdbcCommand(casetypequery, casetype);
                  String casetypefromdropdown = DropDownList3.SelectedItem.ToString();
                  casetypecmd.Parameters.AddWithValue("?", casetypefromdropdown);
                  using (OdbcDataReader casetypeMyReader = casetypecmd.ExecuteReader())
                  {
                      while (casetypeMyReader.Read())
                      {
                          String casename = casetypeMyReader["casename"].ToString();
                          HiddenField1.Value = casename;
                      }
                  }
  
                  //************to get pet  res
                  OdbcCommand petrescmd = new OdbcCommand(petresquery, casetype);
                  petrescmd.Parameters.AddWithValue("?", digit);
                  petrescmd.Parameters.AddWithValue("?", digit);
                  using (OdbcDataReader respetMyReader = petrescmd.ExecuteReader())
                  {
                      while (respetMyReader.Read())
                      {
                          petitioner1 = respetMyReader["pet_name"].ToString();
  
                          //petitioner1 = petitioner.Substring(0, 1) + petitioner.Substring(1).ToLower();
                          resp1 = respetMyReader["res_name"].ToString();
                          //resp1 = resp.Substring(0, 1) + resp.Substring(1).ToLower();
  
                          //String fil_no = respetMyReader["fil_no"].ToString();
                          //HiddenField4.Value = fil_no;
                          ////Response.Write(HiddenField4.Value);
                      }
                      if (petitioner1 == "")
                      {
                          Response.Write("&lt;b&gt;&lt;font color='red'&gt;Wrong Entry!!!");
                      }
                  }
  
  
                  //*******to get respondants
  
                  String respo = HiddenField4.Value;
                  OdbcCommand respocmd = new OdbcCommand(respoquery, casetype);
                  respocmd.Parameters.AddWithValue("?", respo);
                  using (OdbcDataReader respoMyReader = respocmd.ExecuteReader())
                  {
                      while (respoMyReader.Read())
                      {
                          respo1 = respoMyReader["sr_no"].ToString();
                          respo2 = respoMyReader["partyname"].ToString();
                          addr1 = respoMyReader["addr1"].ToString();
                          addr2 = respoMyReader["addr2"].ToString();
                          res = Convert.ToInt32(respo1);
                          //Response.Write(res);
                          //Response.Write(respo2);
  
                          //editorcont1 = "&lt;table&gt;&lt;tr&gt;&lt;td width='10'&gt;" + res + "&lt;/td&gt;&lt;td&gt;"+"&lt;P align= 'left'&gt;"+  respo2 +"&lt;/P&gt;&lt;/td&gt;"+"&lt;/br&gt;";
  
                          ////HiddenField7.Value = editorcont1;
                          //asd(editorcont1);
  
                          //respondants = respo2.Substring(0, 1) + respo2.Substring(1).ToLower();
                          //addr1 = addr1.Substring(0, 1) + addr1.Substring(1).ToLower();
                          //addr2 = addr2.Substring(0, 1) + addr2.Substring(1).ToLower();
                          editorcont1 = res + ")&amp;nbsp;&amp;nbsp;" + respo2 + "&lt;br/&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;" + addr1 + "&amp;nbsp;&amp;nbsp;" + addr2 + "&lt;br/&gt;";
                          sb = sb + editorcont1;
                      }
                  }
  
                  //*******to get order
                  OdbcCommand ordecmd = new OdbcCommand(ordequery, casetype);
                  ordecmd.Parameters.AddWithValue("?", HiddenField4.Value);
                  ordecmd.Parameters.AddWithValue("?", dbDate);
                  using (OdbcDataReader ordeMyReader = ordecmd.ExecuteReader())
                  {
                      while (ordeMyReader.Read())
                      {
                          order = ordeMyReader["orde"].ToString();
                      }
  
                  }
                  //*******to get nextdate
                  OdbcCommand nextdatecmd = new OdbcCommand(nextdatequery, casetype);
                  nextdatecmd.Parameters.AddWithValue("?", HiddenField4.Value);
                  nextdatecmd.Parameters.AddWithValue("?", dbDate);
                  using (OdbcDataReader nextdateMyReader = nextdatecmd.ExecuteReader())
                  {
                      while (nextdateMyReader.Read())
                      {
                        nextdate = nextdateMyReader["next_dt"].ToString();
  
                      }
                   nextdate1 = Convert.ToDateTime(nextdate).ToString("dd/MM/yyyy");
  
  
                  }
  
                  //*********to get jud1
                  OdbcCommand jud1cmd = new OdbcCommand(jud1query, casetype);
                  jud1cmd.Parameters.AddWithValue("?", HiddenField4.Value);
                  jud1cmd.Parameters.AddWithValue("?", dbDate);
                  using (OdbcDataReader jud1MyReader = jud1cmd.ExecuteReader())
                  {
                      while (jud1MyReader.Read())
                      {
                          judge1 = jud1MyReader["jname"].ToString();
                          jjj = "J";
                      }
                  }
  
  
                  //*********to get jud2
                  OdbcCommand jud2cmd = new OdbcCommand(jud2query, casetype);
                  jud2cmd.Parameters.AddWithValue("?", HiddenField4.Value);
                  jud2cmd.Parameters.AddWithValue("?", dbDate);
                  using (OdbcDataReader jud2MyReader = jud2cmd.ExecuteReader())
                  {
                      while (jud2MyReader.Read())
                      {
                          judge2 = jud2MyReader["jname"].ToString();
                          jjj = "JJ";
                      }
                  }
  
  
                  //*********to get jud3
                  OdbcCommand jud3cmd = new OdbcCommand(jud3query, casetype);
                  jud3cmd.Parameters.AddWithValue("?", HiddenField4.Value);
                  jud3cmd.Parameters.AddWithValue("?", dbDate);
                  using (OdbcDataReader jud3MyReader = jud3cmd.ExecuteReader())
                  {
                      while (jud3MyReader.Read())
                      {
                          judge3 = jud3MyReader["jname"].ToString();
                          jjj = "JJJ";
                      }
                  }
  
  
  
  
  
  
                  String tyear = TextBox2.Text;
                  tyear = tyear.Remove(0, 2);
  
                  String year = DateTime.Now.Year.ToString();
                  year = year.Remove(0, 2);
  
                  TextBox4.Text = order;
  
                  string editorcontents =
          "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;No. J/" + DropDownList3.SelectedItem + "-" + TextBox1.Text + "-" + tyear + "/" + "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;" + "/" + year +
          "&lt;br/&gt;" + "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Date:" + DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year +
  
          "&lt;br/&gt;" + "&lt;P align='center'&gt;&lt;b&gt; IN THE HIGH COURT OF BOMBAY AT GOA &lt;/b&gt;&lt;/P&gt;" +
          "&lt;P align='center'&gt;&lt;b&gt;PANAJI GOA&lt;/font&gt;&lt;/b&gt;&lt;/P&gt;" +
          "&lt;br/&gt;" + "&lt;P align='center'&gt;&lt;u&gt;&lt;b&gt;" + HiddenField1.Value + " NO. " + TextBox1.Text + " OF " + TextBox2.Text + "&lt;/b&gt;&lt;/u&gt;&lt;/P&gt;" +
          "&lt;P align='center'&gt;&lt;font size=3&gt;(Under Article 227 of the Constitution of India)&lt;/font&gt;  &lt;/P&gt;" +
  
          "&lt;br /&gt;" +
          "&lt;table&gt;&lt;tr&gt;&lt;td width='750px'&gt;&lt;p align='left'&gt;" + petitioner1 + "&lt;/p&gt;" + "&lt;/td&gt;&lt;td&gt;" + "&lt;p align='right'&gt;" + "..Petitioner" + "&lt;/p&gt;" + "&lt;/td&gt;&lt;/tr&gt;" + "&lt;tr&gt;&lt;td&gt;&lt;p align='center'&gt;" + "V/s" + "&lt;/p&gt;" + "&lt;/td&gt;&lt;td&gt;&lt;/td&gt;" + "&lt;/tr&gt;" + "&lt;tr&gt;&lt;td width='75px'&gt;&lt;p align='left'&gt;" + resp1 + "&lt;/p&gt;" + "&lt;/td&gt;&lt;td&gt;" + "&lt;p align='right'&gt;" + "..Respondent" + "&lt;/p&gt;" + "&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;" +
                      //"&lt;p align='left'&gt;" + petitioner1 + "&lt;p align='right'&gt;" + "...petitioner"+"&lt;/p&gt;"+
  
          "&lt;br/&gt;" + "&lt;P align= 'left'&gt;From" +
          "&lt;br/&gt;" + "Assistant Registrar," +
          "&lt;br/&gt;" + "High Court Of Bombay at Goa Panaji Bench&lt;/P&gt;" +
  
  
          "&lt;br/&gt;" + "&lt;P align= 'left'&gt;To,&lt;/P&gt;" +
          "&lt;br/&gt;" + sb + "&lt;/br&gt;" +
  
  
          "&lt;br/&gt;" + "&lt;P align= 'left'&gt;Sir,&lt;/P&gt;&lt;/br&gt;" +
          "&lt;P align='justify'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;" + "The Petitioner abovenamed having presented a Petition to this Court under Article 227 of the Constitution of India, praying for reliefs as stated in the accompanying copy of the petition and the same having been registered in this Court as Writ Petition and this Court, having on the " +
          "&lt;font color='#0000FF'&gt;" + TextBox3.Text + "&lt;/font&gt;" + " ordered to issue notice, I have the honour to inform you that the matter will come up for " +
          "&lt;b&gt;&lt;u&gt;" + "admission  on " + "&lt;font color='#0000FF'&gt;" + nextdate1 + "&lt;/font&gt;" + " at 10.30 a.m. or thereafter on any day as per the convenience of this Court," + "&lt;/u&gt;&lt;/b&gt;" +
          "and that if no appearance is made on your behalf either in person or by an Advocate of this Court or an agent duly authorized and instructed by you, it will be heard and determined in your absence." + "&lt;/P&gt;" +
  
          "&lt;br/&gt;&lt;P align='center'&gt;" + "Coram : " + judge1 + ", " + judge2 + ", " + judge3 +jjj+ "&lt;/P&gt;" +
  
  
          "&lt;br/&gt;" +
          "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;P align='justify'&gt;" + order.Replace(Environment.NewLine, "&lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;") + "&lt;/P&gt;" +
  
  
          "&lt;br/&gt;&lt;br/&gt;" + "&lt;P align= 'right'&gt;" + "By Order of the Court,".Replace(Environment.NewLine, "&lt;br/&gt;") + "&lt;/P&gt;" +
          "&lt;br/&gt;&lt;br/&gt;" + "&lt;P align= 'right'&gt;( G. M. Redker )&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;" +
          "&lt;br/&gt;" + "Assistant Registrar &amp;nbsp;" +
          "&lt;br/&gt;" + "High Court of Bombay" +
          "&lt;br/&gt;" + "Panaji Bench (Goa)&amp;nbsp;&amp;nbsp;&amp;nbsp;" + "&lt;/P&gt;" +
  
  
          "&lt;br/&gt;&lt;P align='left'&gt;" + "Enclosure :-" + "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(i)Copy Of Petition" + "&lt;/P&gt;" +
          "&lt;br/&gt;&lt;P align='left'&gt;" + "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(ii)" + "&lt;/P&gt;" +
          "&lt;br/&gt;&lt;P align='left'&gt;" + "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;(iii)" + "&lt;/P&gt;" +
  
  
          "&lt;br/&gt;&lt;P align='justify'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;" + "N.B. :- Attention is invited to Rules 11 and 13, Chapter XVII of the High Court Appellate Side Rules, 1960, which reads as follows :-" + "&lt;/P&gt;" +
          "&lt;br/&gt;&lt;P align='justify'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;" + "Rule 11 :- An answer to the rule nisi showing cause against such application shall be made by filing an affidavit in the Office of the Registrar and by serving a copy thereof upon the applicant or his Advocate or attorney, as the case may be, at least two days before the returnable date of the rule." + "&lt;/P&gt;" +           "&lt;br/&gt;&lt;P align='justify'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;" + "Rule 13 :- No further affidavit or affidavits shall be filed by any party except with the leave of the Court." + "&lt;/P&gt;" +
          "&lt;br/&gt;&lt;p align='left'&gt;" + "ep/-" +
          "&lt;BLOCKQUOTE style='page-break-before: always'&gt;xdfghfdhgrfgbx blah&lt;/BLOCKQUOTE&gt;";
  
                  Editor1.Content = editorcontents;
  
  
     string editorcont2 = "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;No. J/" + DropDownList3.SelectedItem + "-" + TextBox1.Text + "-" + tyear + "/" + "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;" + "/" + year +
                                       "&lt;br/&gt;" + "&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;Date:" + DateTime.Now.Day + "/" + DateTime.Now.Month + "/" + DateTime.Now.Year +
  
                                       "&lt;br/&gt; &lt;br/&gt;" + "&lt;P align='center'&gt;&lt;b&gt; IN THE HIGH COURT OF BOMBAY AT GOA " +
                                       "&lt;br/&gt;" + " PANAJI BENCH &lt;/b&gt;&lt;/P&gt;" +
  
                                       "&lt;/br&gt;" + "&lt;P align='center'&gt;" + "&lt;u&gt;&lt;b&gt;" + HiddenField1.Value + " NO. " + TextBox1.Text + " OF " + TextBox2.Text + " &lt;/P&gt;" + "&lt;/b&gt;&lt;/u&gt;" +
  
                                       "&lt;br/&gt; &lt;br/&gt;" + "&lt;P align='justify'&gt; From," +
                                       "&lt;br/&gt;" + " The ASSISTANT REGISTRAR " +
                                       "&lt;br/&gt;" + " High Court of Bombay at Goa" +
                                       "&lt;br/&gt;" + " Panaji Bench &lt;/P&gt;" +
  
                                       "&lt;br/&gt; &lt;br/&gt;" + "&lt;P align='justify'&gt; To," +
                                       "&lt;br/&gt;" + " The Registrar," +
                                       "&lt;br/&gt;" + " City Civil Court " +
                                       "&lt;br/&gt;" + " Bangalore &lt;/P&gt;" +
  
                                       "&lt;br/&gt; &lt;br/&gt;" + "&lt;P align='left'&gt; Sir, &lt;/P&gt;" +
  
  
                                       "&lt;br/&gt;" + "&lt;P align='justify'&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;" + "I  have  the honour to forward herewith the accompanying notice  alongwith   copy   of petition  for  service on the Respondent  No.   2   in the  case noted above and to request you  to be  so  good  as  to arrange  to  serve  the Original  copy and to return the office copy to this Court duly served AT THE EARLIEST by causing  the Original notice to be delivered to  the  Respondent  No.  2  and  by  obtaining  the acknowledgement on the Office Copy.  If the said notice does not fall under your jurisdiction, kindly forward the same to the Court under whose jurisdiction it comes, under intimation to this office.  Service Report may please be translated to English, if written in any other language. &lt;/p&gt;" +
  
                                       "&lt;br/&gt;&lt;br/&gt;" + "&lt;P align= 'right'&gt;" + "By Order of The Court," +
                                       "&lt;br/&gt;&lt;br/&gt;" + "( G. M. Redker )&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;" +
                                       "&lt;br/&gt;" + "Assistant Registrar &amp;nbsp;" +
                                       "&lt;br/&gt;" + "High Court of Bombay" +
                                       "&lt;br/&gt;" + "Panaji Bench (Goa)&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;/P&gt;" +
                                       "&lt;br/&gt; &lt;P align='left'&gt;Encl. " +
                                       "&lt;br/&gt; rc/- &lt;/P&gt;";
     Editor2.Content = editorcont2;
              }
          }
          catch (Exception er)
          { }
  
  
  
      }
      protected void Button2_Click(object sender, EventArgs e)
      {
  
          String dbDate = DateTime.ParseExact(TextBox3.Text, "dd/mm/yyyy", null).ToString("yyyy-mm-dd");
  
          //Extract data from Page (pd).
          //Label16.Text = Editor1.Content; // Attribute
          // makae ready HttpContext
          HttpContext.Current.Response.Clear();
          HttpContext.Current.Response.ContentType = "application/pdf";
          // Create PDF document
          Document pdfDocument = new Document(PageSize.A4, 80, 50, 30, 65);
  
  
          PdfWriter wri = PdfWriter.GetInstance(pdfDocument, new FileStream("d://" + HiddenField1.Value + HiddenField4.Value + dbDate + ".pdf", FileMode.Create));
  
          PdfWriter.GetInstance(pdfDocument, HttpContext.Current.Response.OutputStream);
  
          pdfDocument.Open();
          string htmlText = Editor1.Content;
          //string htmlText = htmlText1.Replace(Environment.NewLine, "&lt;br/&gt;");
          System.Collections.Generic.List&lt;IElement&gt; htmlarraylist = HTMLWorker.ParseToList (new StringReader(htmlText), null);
          //Paragraph paragraph = new Paragraph("This is my first line using Paragraph.");
          //pdfDocument.Add(paragraph);
          for (int k = 0; k &lt; htmlarraylist.Count; k++)
          {
              pdfDocument.Add((IElement)htmlarraylist[k]);
  
          }
  
     //***********FORWARDING LETTER     
          pdfDocument.NewPage();
          string htmlText2 = Editor2.Content;
  
          System.Collections.Generic.List&lt;IElement&gt; htmlarraylist2 = HTMLWorker.ParseToList(new StringReader(htmlText2), null);
          for (int k = 0; k &lt; htmlarraylist2.Count; k++)
          {
              pdfDocument.Add((IElement)htmlarraylist2[k]);
  
          }
          pdfDocument.Close();
          HttpContext.Current.Response.End();
      }
  
  
  
      protected void Button3_Click(object sender, EventArgs e)
      {
          String dbDate = DateTime.ParseExact(TextBox3.Text, "dd/mm/yyyy", null).ToString("yyyy-mm-dd");
  
          OdbcConnection MyConnection = new OdbcConnection("Driver={MySQL ODBC 3.51 Driver};Server=10.155.160.130;Database=testcase;User=root;Password=;Option=3;");
          MyConnection.Open();
          String MyString = "select notice from notice_aspx where fil_no=? and orderdate=?";
          OdbcCommand MyCmd = new OdbcCommand(MyString, MyConnection);
          MyCmd.Parameters.AddWithValue("", HiddenField4.Value);
          MyCmd.Parameters.AddWithValue("", dbDate);
          using (OdbcDataReader MyReader4 = MyCmd.ExecuteReader())
          {
              //**
              if (MyReader4.Read())
              {
  
                  String MyString1 = "UPDATE notice_aspx SET notice=? where fil_no=? AND orderdate=?";
                  OdbcCommand MyCmd1 = new OdbcCommand(MyString1, MyConnection);
                  MyCmd1.Parameters.AddWithValue("", Editor1.Content.ToString());
                  MyCmd1.Parameters.AddWithValue("", HiddenField4.Value.ToString());
                  MyCmd1.Parameters.AddWithValue("", dbDate);
                  MyCmd1.ExecuteNonQuery();
              }
  
  
  
              else
              {
  
                  // set the SQL string
                  String strSQL = "INSERT INTO notice_aspx (fil_no,notice,orderdate) " +
                  "VALUES (?,?,?)";
  
                  // Create the Command and set its properties
                  OdbcCommand objCmd = new OdbcCommand(strSQL, MyConnection);
                  //Response.Write("****"+HiddenField4.Value);
                  objCmd.Parameters.AddWithValue("", HiddenField4.Value.ToString());
                  objCmd.Parameters.AddWithValue("", Editor1.Content.ToString());
                  objCmd.Parameters.AddWithValue("", dbDate);
  
                  // execute the command
                  objCmd.ExecuteNonQuery();
  
  
  
              }
  
  
          }
      }
      protected void Button4_Click(object sender, EventArgs e)
      {
  
      }
      protected void Button4_Click1(object sender, EventArgs e)
      {
          Editor2.Visible = true;
      }
  }
  </code></pre>
  
  <p><strong>.CS code as follows</strong></p>
  
  <p>Please refer:
  <a href="https://stackoverflow.com/questions/4612601/calling-a-c-function-in-asp-net">Calling a C# function in asp.net</a>
  How to solve the issue.</p>