2014-09-11 34 views
0

我设计了一个mypanel.aspx作为我的项目中的默认页面。我使用telerik面板并给出了该面板中的所有控件。在vb page我无法访问像“文本框,按钮”的控件。从一些参考文献我用Namespacemypanel.aspx。但使用我得到了网页上的解析器误差从default.aspx使用inhertis解析器错误

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 

错误行mypanel.aspx:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="panel.aspx.vb" Inherits="mypanel.panel" %> 

mypanel.vb:

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 

回答

0

更改班级的名称,因为它与您的名称空间相同。在继承中,您需要写出类的名称而不是命名空间,因此请更改您的类的名称或尝试此操作

Inherits="mypanel.panel.panel"