简体   繁体   中英

page not loading in asp.net while debugging

i have a small 2 aspx page vb.net application. its has main.aspx with main.aspx.vb in back. first line on aspx reads -

<%@ Page Language="VB" 
         AutoEventWireup="false" 
         codebehind="main.aspx.vb" 
         Inherits="a1_main" %>

first lines of main.aspx.vb read -

Partial Public Class a1_main
    Inherits System.Web.UI.Page

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) 
        Handles Me.Load

    End Sub
End Class

its completely blank. but when i try to debug it just to see design on aspx page it gives me this error -

Could not load type 'a1_main'. Line 1: <%@ Page Language="VB" AutoEventWireup="false" codebehind="main.aspx.vb" Inherits="a1_main" %>

what is wrong here? how do i fix this

I think the problem is that the file does not know which object to use. Have a look in your global.asax file, you should see a line like the following.

<@ Application Codebehind="Global.asax.vb" Inherits="XXX.Global_asax" Language="vb" %>

You need to take what ever is place of the "XXX" and put it in your code like below.

<@ Page Language="VB" 
     AutoEventWireup="false" 
     codebehind="main.aspx.vb" 
     Inherits="XXX.a1_main" %>

That is what fixed my problem.

Looks ok. Have you compiled the project? Perhaps there is some problem in your other codebehind file that is causing a build error.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM