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'.
开发者_StackOverflow中文版Line 1: <%@ Page Language="VB" AutoEventWireup="false" codebehind="main.aspx.vb" Inherits="a1_main" %>
what is wrong here? how do i fix this
Looks ok. Have you compiled the project? Perhaps there is some problem in your other codebehind file that is causing a build error.
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.
精彩评论