简体   繁体   English

调试时页面未在asp.net中加载

[英]page not loading in asp.net while debugging

i have a small 2 aspx page vb.net application. 我有一个小的2 aspx页面vb.net应用程序。 its has main.aspx with main.aspx.vb in back. 它具有main.aspx,后面有main.aspx.vb。 first line on aspx reads - aspx的第一行显示-

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

first lines of main.aspx.vb read - main.aspx.vb的第一行显示为-

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 - 但是当我尝试调试它只是为了在aspx页面上查看设计时,它给了我这个错误-

Could not load type 'a1_main'. 无法加载类型'a1_main'。 Line 1: <%@ Page Language="VB" AutoEventWireup="false" codebehind="main.aspx.vb" Inherits="a1_main" %> 第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. 看看您的global.asax文件,您应该看到如下一行。

<@ 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. 您需要将“ XXX”替换为任何地方,并将其放入您的代码中,如下所示。

<@ 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. 可能您的其他代码隐藏文件中存在某些导致构建错误的问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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