为什么我的ASP.NET代码里会出现BC30037字符无效的错误?
- 内容介绍
- 文章标签
- 相关推荐
本文共计470个文字,预计阅读时间需要2分钟。
我已经开始学习ASP.NET了。我已掌握基础知识,现在开始构建小型应用程序。我正在使用VS 2012并使用VB创建空Web应用程序项目。我可以看到web.config文件自动创建,以下是其中的一行:
我已经开始学习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 go.microsoft.com/fwlink/?LinkId=169433 --> <configuration> <system.web> <compilation debug="true" strict="false" explicit="true" targetFramework="4.5" /> <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:\users\anjum.banaras\documents\visual studio 2012\Projects\Students\Students\Default.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" %>
本文共计470个文字,预计阅读时间需要2分钟。
我已经开始学习ASP.NET了。我已掌握基础知识,现在开始构建小型应用程序。我正在使用VS 2012并使用VB创建空Web应用程序项目。我可以看到web.config文件自动创建,以下是其中的一行:
我已经开始学习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 go.microsoft.com/fwlink/?LinkId=169433 --> <configuration> <system.web> <compilation debug="true" strict="false" explicit="true" targetFramework="4.5" /> <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:\users\anjum.banaras\documents\visual studio 2012\Projects\Students\Students\Default.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" %>

