ASP.net错误:BC30037:字符无效
发布时间:2020-12-16 09:25:57 所属栏目:asp.Net 来源:网络整理
导读:我已经开始学习asp.net了.我经历了基础知识,现在我开始构建小型应用程序. 我正在使用VS 2012并使用VB创建了空Web应用程序项目. 我可以看到web.config自动创建,以下是写在其中的行: ?xml version="1.0"?!-- For more information on how to configure your A
我已经开始学习asp.net了.我经历了基础知识,现在我开始构建小型应用程序.
我正在使用VS 2012并使用VB创建了空Web应用程序项目. 我可以看到web.config自动创建,以下是写在其中的行: <?xml version="1.0"?> <!-- For more information on how to configure your ASP.NET application,please visit http://go.microsoft.com/fwlink/?LinkId=169433 --> <configuration> <system.web> <compilation debug="true" strict="false" explicit="true" targetFramework="4.5" /> <httpRuntime targetFramework="4.5" /> </system.web> </configuration> 我创建了Default.aspx文件并编写了以下代码行: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" %> <% HelloWorldLabel.Text = "Hello,world!"; %> <!DOCTYPE html> <html xmlns="http://www.w3.org/1999/xhtml"> <head runat="server"> <title></title> </head> <body> <form id="form1" runat="server"> <div> <asp:Label runat="server" id="HelloWorldLabel"></asp:Label> </div> </form> </body> </html> 当我在浏览器上运行此应用程序时,我收到以下错误页面: Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: BC30037: Character is not valid. Source Error: Line 2: Line 3: <% Line 4: HelloWorldLabel.Text = "Hello,world!"; Line 5: %> Line 6: Source File: c:usersanjum.banarasdocumentsvisual studio 2012ProjectsStudentsStudentsDefault.aspx Line: 4 谁可以帮我这个事 ?我只是asp.net的初学者.你的帮助可以节省我的大量时间. 提前感谢你!! 解决方法
您已将页面的编程语言设置为VB(Visual Basic),但它所抱怨的行是用C#语法编写的.将该行更改为有效的VB代码:
HelloWorldLabel.Text = "Hello,world!" (我认为删除;是所有需要的,但我从不编写VB所以我不确定) 或将页面语言更改为C#: <%@ Page Language="c#" AutoEventWireup="false" CodeBehind="Default.aspx.vb" %> (编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- 在ASP.NET MVC中获取原始请求
- ASP.NET如何知道单击哪个Button以引发其事件
- asp.net-mvc – 可以使用ASP.Net MVC Razor视图来生成格式很
- asp.net-mvc – 如何在ASP.NET MVC中为经过身份验证的用户关
- asp.net – 在代码中获取页面的绝对URL
- asp.net – 如何防止asp:Timer在生成响应之前发送tick?
- ASP.NET MVC的客户端验证:jQuery的验证
- asp.net – Web Forms错误消息:“这不是scriptlet 将输出为
- asp.net – 在WAP转换期间无法解析.aspx
- asp.net – 如何在不构建网站的情况下使用MSBuild解析网站引
推荐文章
站长推荐
- asp.net – 编译器失败,错误代码为-1073741819
- asp.net – RegisterStartupScript不适用于Scrip
- 强制CamelCase在ASP.NET WebAPI每个控制器
- 在ASP.NET Web Forms 4.5中捆绑JQuery
- asp.net – AspNetCompatibilityRequirements是什
- 在asp.net上调用两个函数按钮onclick
- .Net Core微服务入门全纪录(三)——Consul-服务
- asp.net-mvc – 查看模型IEnumerable <>属性返回
- asp.net – 检查IE浏览器 – .NET
- 如何在asp.net mvc项目中使用Material-UI
热点阅读