为什么我会收到此错误,我要知道原因 [英] Why do i get this error i want the reason

查看:65
本文介绍了为什么我会收到此错误,我要知道原因的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述


我想在head标签中找到控件时遇到以下错误
无法修改控件集合,因为控件包含代码块(即<%...%>)

Hi
i got the following error when i wanted to find a control in the head tag
The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>)

推荐答案

更改您的<%=(响应.将表达式写到<%#(数据绑定表达式),看看是否没有帮助.

如果您想了解有关两者之间差异的更多信息以及其他变体,则google是您的朋友.
Change your <%= (a response.Write expression) to <%# (a databinding expression), and see if that doesn''t help.

If you want more info on the differences between the two, as well as additional variations, google is your friend.


如果您有这样的脚本标签:
If you have script tags like this:
<%= DateTime.Now %>


而是将它们替换为DataBinding表达式.像这样:


Replace them with DataBinding expressions instead. Like this:

<%# DateTime.Now %>


这篇关于为什么我会收到此错误,我要知道原因的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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