razor使用注意点........
2024-08-26 15:33:38
使用三元运算符时记得加括号。。。。
如:
@Convert.ToInt32(Request.QueryString["type"])==0?true:false :这是错误的写法
@(Convert.ToInt32(Request.QueryString["type"])==0?true:false) 这是正确的写法!!!!!!!
把后台数据存入js中当变量用
var type = '@Convert.ToInt32(Request.QueryString["type"])';
if (type == 1) {
$("#atf-subsidyApply").show();
}
if (type == 2) {
$("#atf-youfu").show();
}
if (type == 3) {
$("#atf-societyHelp").show();
}
最新文章
- SVN 提交代码时提示文件已经存在解决办法
- C/C++程序员应聘试题剖析(转载)
- dedecms /install/index.php.bak Installation File Not Deleted &;&; Executed Via Apache Analytic Vul
- [题解+总结]NOIP2013-2014提高组题目浅析
- HDU 2571 命运 动态规划
- android开发中R文件丢失
- 数学之美 zt
- 剑指offter-面试题7.用两个栈实现队列
- Qt事件和事件循环
- 超详细的 Linux CentOS 编译安装python3
- java 中的基本数据类型
- (原创)Verilog三段式状态机
- springmvc 在非controller下使用@autowired
- 让simplejson支持datetime类型的序列化
- linux笔记-多服务器同时执行相同命令
- Leanote 蚂蚁笔记 云笔记
- ETL工具总结
- 异步IO的概念
- 搜索引擎ElasticSearchV5.4.2系列二之ElasticSearchV5.4.2+kibanaV5.4.2+x-packV5.4.2安装
- 常用jQuery知识