Asp.net 使用default.aspx中的inhertis时出现分析器错误
我已经设计了一个Asp.net 使用default.aspx中的inhertis时出现分析器错误,asp.net,vb.net,Asp.net,Vb.net,我已经设计了一个mypanel.aspx作为项目中的默认页面。我使用了telerik面板,并给出了该面板内的所有控件。在vb页面中,我无法访问诸如“textbox,button”之类的控件。从一些参考资料中,我将名称空间用于mypanel.aspx。但是在使用它之后,我在网页上得到了一个解析器错误 Server Error in '/' Application. Parser Error Description: An error occurred during the parsing
mypanel.aspx
作为项目中的默认页面。我使用了telerik面板,并给出了该面板内的所有控件。在vb页面
中,我无法访问诸如“textbox,button”之类的控件。从一些参考资料中,我将名称空间用于mypanel.aspx
。但是在使用它之后,我在网页上得到了一个解析器错误
Server Error in '/' Application.
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: 'mypanel.panel' is not allowed here because it does not extend class 'System.Web.UI.Page'.
Source Error:
Line 1: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="panel.aspx.vb" Inherits="mypanel.panel" %> Line 2: Line 3: <%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
Source File: /panel.aspx Line: 1
更改类的名称,因为它与命名空间相同。在继承中,您需要写入类的名称而不是名称空间,因此请更改类的名称或尝试以下操作
Inherits="mypanel.panel.panel"
Imports System.Web.UI.WebControls
Imports System
Imports Telerik.Web.UI
Namespace mypanel.panel
Partial Public Class panel
Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
End Sub
Protected Sub btnsumbmit_click()
Response.Redirect("empty.aspx")
End Sub
End Class
End Namespace
Inherits="mypanel.panel.panel"