我有一个webapplcation名称HRM。现在我试图添加一个文件aspx与另一个项目名称HRM1(也是web applicaitonFile),但我收到此错误,因为我试图在浏览器中看到该文件:** Pareser ERROR。
描述:解析为此请求提供服务所需的资源时发生错误。请查看以下特定的解析错误详细信息并相应地修改源文件。消息:无法加载类型'HRM1.WebForm10'。 第1行:<%@ Page Title =“”Language =“C#”MasterPageFile =“〜/ Site.Master”AutoEventWireup =“true”CodeBehind =“Nationality.aspx.cs”Inherits =“HRM1.WebForm10” %GT; **
我也尝试了inherits =“HRM1.WebForm10”,但是同样的解析器错误我不知道为什么?我正在使用VS 12和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;
}
}
}
}
答案 0 :(得分:0)
目标项目中是否存在母版页“〜/ Site.Master”? 你有没有很好地导入.apsx,.aspx.vb和.aspx.designer.vb文件?