ASP.NET中的页面解析器错误 [英] Page Parser ERROR in ASP.NET

查看:118
本文介绍了ASP.NET中的页面解析器错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我经常遇到一个问题,即页面解析错误....
为了摆脱这种困境,我曾经在Page Directive中删除了继承属性.


在那之后,它显示了编译错误????


如何解决呢????对于页面编译问题和页面解析器错误,我该怎么办????


还有一件事是,我打开该项目后,如果我双击该按钮,我将编写一个button1单击事件k的代码,如果要双击该按钮,我将进行内联编码..如何解决它..即使我使用了1个按钮在那个按钮事件中,我在事件上单击了doube仍然没有用...我正在重定向到内联编码.如何解决该页面的问题.我应该重定向到仅文件后面的代码

Frequently i came accross a problem that is Page parse error....
to get out of this hell i used to remove inherit attribute in Page Directive.


After that it is showing compliation error???


How to solve it ???? what i have to do for the page compilation problem and page parser error tooo?????


And 1 more thing is i had written the code of a button1 click event k after after i had opened that project if i double click on that button i am going to inline coding.. How to solve it..Even though i took 1 button in that button events i doube clicked on a event still there is no use...I am redirecting to inline coding. How to solve the problem of that page. I should redirect to code behind file only

推荐答案

在使用单独的代码文件时遇到了此问题,因此我假设这就是您编写页面的方式.

HTML页面的@Page指令使用CodeFile告诉编译器文件的位置,并使用Inherits告诉编译器一旦找到该文件怎么办.

您会注意到,代码隐藏文件是默认情况下从System.Web.UI.Page继承的部分类.类名称与HTML页面的Inherits属性中使用的名称相同.如果要将页面的类更改为默认类以外的其他类,则需要在后面的代码中进行更改;否则,请执行以下操作.无需更改Inherits.

我希望与按钮有关的问题.如果您摆脱了Inherits,则编译器将无法再将HTML页面的类"与隐藏代码的部分类合并.因此,编译器将假定所有代码都在HTML页面上内联并采取相应的措施.
I have run into this problem when using separate code files, so I will assume that this is how you are writing your pages.

The HTML page''s @Page directive uses CodeFile to tell the compiler where the file is located, and Inherits to tell the compiler what to do with it once it has been found.

You will note that the code-behind file is a partial class that, by default, inherits from System.Web.UI.Page. The class name is the same one used in the HTML page''s Inherits attribute. If you are changing the page''s class to something other than the default, you need to change it in the code-behind; there should be no need to change Inherits.

I expect the problem with the button is related. If you get rid of Inherits, the compiler can no longer merge the "class" of the HTML page with the partial class of the code-behind. So, the compiler will assume that all code is inline on the HTML page and act accordingly.


这篇关于ASP.NET中的页面解析器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆