I have a webapplcation name HRM. Now i am trying to add a file aspx with another project name HRM1 (also web applicaitonFile), but i am getting this error as i try to see that file in browser: **Pareser ERROR.
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Message: Could not load type 'HRM1.WebForm10'. Line 1: <%@ Page Title="" Language="C#" MasterPageFile="~/Site.Master" AutoEventWireup="true" CodeBehind="Nationality.aspx.cs" Inherits="HRM1.WebForm10" %>**
I also have try inherits= "HRM1.WebForm10", but the same parser error ocurring i dont know why? I am using VS 12 and webapplication.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using HRM1.App_Code.BLL;
namespace HRM
{
public partial class WebForm10 : System.Web.UI.Page
{
clsNationality objNationality = new clsNationality();
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
// BindNationality();
}
}
protected void BindNationality()
{
gvNationality.DataSource = objNationality.SelectAll();
gvNationality.DataBind();
}
protected void btn_Ins_Nation_Click(object sender, EventArgs e)
{
objNationality.Name = txtNationalityName.Text;
int a = objNationality.Insert();
if (a > 0)
{
lblOutPut.Text = "Successfully Insert";
}
else
{
lblOutPut.Text = "Error";
}
}
protected void btn_update_Nation_Click(object sender, EventArgs e)
{
objNationality.User_ID = 1;
objNationality.Nation_ID = Convert.ToInt32(ViewState["RecordNo"]);
objNationality.Name = txtNationalityName.Text;
int b= objNationality.Update();
BindNationality();
if (b > 0)
{
BindNationality();
lblOutPut.Text = "Successfully Updated";
}
else
{
lblOutPut.Text = "Error";
}
}
protected void btn_dlt_Nation_Click(object sender, EventArgs e)
{
objNationality.Name = txtNationalityName.Text;
int c = objNationality.Delete();
if (c > 0)
{
lblOutPut.Text = "Successfully Deleted";
BindNationality();
}
else
{
lblOutPut.Text = "Delete Error";
}
}
protected void gvNationality_RowCommand(object sender, GridViewCommandEventArgs e)
{
if (e.CommandName.ToString().ToUpper() == "EDIT")
{
ViewState["RecordNo"] = Convert.ToInt32(e.CommandArgument);
objNationality.Nation_ID = Convert.ToInt32(ViewState["RecordNo"]);
objNationality.SelectByID();
txtNationalityName.Text = objNationality.Name;
}
}
}
}