2014-09-11 39 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"