title: How to call .cs file from a .aspx.cs in asp.net c#
body: <p>I have a <code>a1.aspx.cs</code> file and i have created new <code>class1.cs</code> file. I want to call a function in a1.aspx.cs which is in class1.cs</p>
  
  <p>When i  write a method in <code>a1.aspx.cs</code> everything works fine, but when i try to copy paste the contents which are there in button click event into <code>class1.cs</code> file and call that function i <strong>am unable to get all the controls that i have used in my web page,what parameters am i supposed to pass</strong>??</p>
  
  <p>and error comes as</p>
  
  <pre><code>Error   1   The name 'DropDownList1' does not exist in the current context
  </code></pre>
  
  <p>and many more such errors.
  Please help me to understand how to call a function in <code>a1.aspx.cs</code></p>