asp.net编译提示__o变量不存在错误

在aspx页面文件中用if或者for逻辑运算代码

csharp 复制代码
     <%foreach (string file in pics){ %>
       <div class="swiper-slide"><img src="pic/<%=file%>" alt=""></div>
     <%} %>

编译器则会提示以下错误

据说是编译器生成的临时变量,编译器会报错,但运行没有任何问题。

如果看到这些错误提示很烦,可以在Code Behind代码中增加已给__o变量

csharp 复制代码
public partial class Default : System.Web.UI.Page
{
  public string __o = "";
  // ...
}
相关推荐
小码哥_常7 小时前
Spring Boot:别再重复造轮子,这些内置功能香麻了
后端
皮皮林5517 小时前
OpenFeign 首次调用卡 3 秒?八年老开发扒透 5 个坑,实战优化到 100ms!
后端
千寻girling9 小时前
《 Git 详细教程 》
前端·后端·面试
0xDevNull10 小时前
Linux 中 Nginx 代理 Redis 的详细教程
redis·后端
GetcharZp10 小时前
告别 Nginx 手动配置!这款 Go 语言开发的云原生网关,才是容器化时代的真香神器!
后端
RuoyiOffice10 小时前
SpringBoot+Vue3 企业考勤如何处理法定假期?节假日方案、调休补班与工作日判断链路拆解
spring boot·后端·vue·anti-design-vue·ruoyioffice·假期·人力
Vane111 小时前
从零开发一个AI插件,经历了什么?
人工智能·后端
9523611 小时前
SpringBoot统一功能处理
java·spring boot·后端
rleS IONS11 小时前
SpringBoot中自定义Starter
java·spring boot·后端
DevilSeagull12 小时前
MySQL(2) 客户端工具和建库
开发语言·数据库·后端·mysql·服务