I created two partial classes for a web page.
Now I have given protection to one say submit () function that I call in the OnSubmit event.
But this function is not called, the program does not compile, because it cannot search for the defination function that was defined in another partial class. Is it possible to call this function, or should I give a defination function in the same file where I call it
eg,
<%@ 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" %>
Registration.aspx.cs
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();
}
}
Registration_Database.cs
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";
}
}
I get the following error
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\
Registration.aspx, Registration.aspx.cs, Registration_Database.cs - , App_Code, , Registration.aspx.cs, Registration_Database.cs Registration.aspx .
Plz ,
DLL.