title: Can i call a function defined in one partial class from another partial class. Is it possible?
body: <p>I have created two partial classes for a web page. </p>
  
  <p>Now i have given a defination of one function say submit() that i m calling at OnSubmit event of button. </p>
  
  <p>But this function is not being called, the program doesnot compiles as it is not able to search the defination of function, which was defined in another partial class. Is it possible to call this function or i have to give defination of function in same file where i m calling it</p>
  
  <p>eg</p>
  
  <pre><code>&lt;%@ Page Language="C#" MasterPageFile="~/Master Pages/LeftMenu.master" AutoEventWireup="true" CodeFile="Registration.aspx.cs" Inherits="Web_Pages_Authentication_Login_Management_Registration" Title="Registration" StylesheetTheme="Default Theme 1"  %&gt;
  </code></pre>
  
  <p>Registration.aspx.cs</p>
  
  <pre><code>public partial class Web_Pages_Authentication_Login_Management_Registration : System.Web.UI.Page
  {
      private string firstName;
      private string lastName;
      private string userName;
      private string userPassword;
      private string primaryEmail;
  protected void btnSubmit_Click(object sender, EventArgs e)
      {
         Display();
      }
  }
  </code></pre>
  
  <p>Registration_Database.cs</p>
  
  <pre><code>   public partial class Web_Pages_Authentication_Login_Management_Registration 
      {
         const string dbFirstName = "@FirstName";
         const string dbLastName = "@LastName";
         const string dbUserName= "@UserName";
         const string dbUserPassword = "@UserPassword";
         const string dbPrimaryEmail = "@PrimaryEmail";  
  
         void Display()
            {
                firstName="XYZ"; //This variable is not accessible when i put both files in different directories
            }
      }
  </code></pre>
  
  <p>I  am getting following error</p>
  
  <pre><code>Error   1   'Web_Pages_Authentication_Login_Management_Registration' does not contain a definition for 'Display' and no extension method 'Display' accepting a first argument of type 'Web_Pages_Authentication_Login_Management_Registration' could be found (are you missing a using directive or an assembly reference?) C:\Documents and Settings\Administrator\Desktop\Online Test\Web Pages\Authentication\Login Management\Registration.aspx.cs  78  20  C:\...\Online Test\
  </code></pre>
  
  <p>Registration.aspx, Registration.aspx.cs, Registration_Database.cs are three files that are not in App_Code folder but belongs to one folder only out of which Registration.aspx.cs, Registration_Database.cs are partial classes and Registration.aspx is my design file.
  Plz let me know if u want to know some more info about my problem</p>
  
  <p><strong>I am not using DLL Files. No precompiled code</strong></p>