首页 > Web开发 > 详细

asp.net mvc 中使用ashx文件时出现错误

时间:2014-02-13 07:37:57      阅读:1223      评论:0      收藏:0      [点我收藏+]

在做asp.net mvc的项目时,用到了ajax,本人习惯用ashx(一般处理程序)处理数据,在进行编译的时候出现了以下错误:

错误1:命名空间不能直接包含字段或方法之类的成员

错误2:原义说明符 @ 之后应为关键字、标识符或字符串

bubuko.com,布布扣

英文释义为:

error 1: A namespace cannot directly contain members such as fields or methods

error 2: Keyword, identifier, or string expected after verbatim specifier: @

搜索了很久,终于在stackflow上找到了一个答案,英文原文是:

I figured it out... The ashx file itself was set to compile, changed it to content and compile only the cs file and it builds..

英文不是很难,就是说把ashx文件的属性改为“内容”,ashx.cs文件的属性改为“编译即可”,测试之后一切可以正常使用。

本文出自 “霏云霏雨” 博客,请务必保留此出处http://laughingsir.blog.51cto.com/2710578/1358433

asp.net mvc 中使用ashx文件时出现错误

原文:http://laughingsir.blog.51cto.com/2710578/1358433

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!