开发者

page not loading in asp.net while debugging

开发者 https://www.devze.com 2022-12-16 23:39 出处:网络
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 -

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号