主页面提供了错误 [英] Master page gives error

查看:210
本文介绍了主页面提供了错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用VS2008的ASP.NET应用程序。

I am using VS2008 for ASP.NET apps.

我的解决方案资源管理器中具有层次结构是这样的:

My Solution Explorer has hierarchy like this:

在开机页面,Default.aspx的,将显示一个登录表单。当我preSS登录按钮,名称,selectCompany另一个页面,应该打开。 selectCompany是其主网页是Master1.Master一个Web内容形式。但它是不开放,而是我得到这个错误:

The start-up page, Default.aspx, displays a Login form. When I press Login button, another Page with the name, selectCompany, should open. selectCompany is a Web Content Form whose master page is Master1.Master. But it is not opening, instead I am getting this error:

Parser 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.

    Parser Error Message: Could not load type 'FlexStock.Forms.master1'.

    Source Error:

    Line 1:  <%@ Master Language="C#" AutoEventWireup="true" CodeBehind="~/Forms/selectCompany.aspx" Inherits="FlexStock.Forms.master1" %>
    Line 2:  
    Line 3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">


    Source File: /Forms/master1.Master    Line: 1 

Master1.master的第一行是这样的:

The first line of Master1.master is like this:

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="master1.master.cs" Inherits="FlexStock.Forms.master1" %>

和网页内容形式,selectCompany.aspx的第一线,是这样的:

And the first line of Web Content Form, selectCompany.aspx, is like this:

<%@ Page Title="" Language="C#" MasterPageFile="~/Forms/master1.Master" AutoEventWireup="true" CodeBehind="selectCompany.aspx.cs" Inherits="FlexStock.Forms.selectCompany" %>

我不下列问题出在哪里。

I am not following where is the problem.

推荐答案

请确保在类名中规定的的 Inhertis 的您的页面指令的双组分< STRONG>匹配类的名字您的 code隐藏文件

Make sure that the class-name stated in the Inhertis-part of your page-directive matches the name of the class in your code-behind file.

Master1.master:

Master1.master:

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="master1.master.cs" Inherits="FlexStock.Forms.master1" %>

Master1.Master.cs:

Master1.Master.cs:

namespace FlexStock.Forms {
    public class master1 {
        /* ... */

这篇关于主页面提供了错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆