服务器变量里面没有ASP控制工作 [英] Server tags not working inside asp controls
问题描述
Alrighty使这个快捷:
Alrighty to make this quick:
- 我要上变化或在页面加载动态设置开始和结束日期为日历扩展
- 的值被投入上的.ascx隐藏字段和页面加载过程中填充在如果不回传
- 一组日历扩展是在网格视图中调用的项目模板字段此设置A
- 其他的都在一个正常的HTML表格 - 集合B
- I want to set start and end dates for a calendar extender dynamically on-change or on page load
- the values are put into hidden fields on the .ascx and populated during page load in an if not postback
- one set of calendar extenders is in the item template field of a grid view call this set A
- the others are in a normal html table - set b
设置和限量喂养有标记起始日期=<%#hfStart.value%GT;结束日期=<%#hfEnd.value%GT;
设置在网格视图列的项目模板就像一个魅力
set a in the item template of a grid view column works like a charm
集合B 在HTML表不会出现在所有的工作。
set b in the HTML table doesn't appear to work at all
怎么办?
到目前为止,我曾尝试与内同一code其他服务器的标签,但我缺少明显的突出细节。为什么一部作品,而不是其他?
So far I have tried other server tags with the same code inside but I am obviously missing the salient detail. Why does one work and not the other?
更新:试过
-
CDATE(hfstart.value)的ToString
以<%:和<%=标记 -
<%= hfstart.value%GT;
CDate(hfstart.value).ToString
with <%: and <%= tags<%= hfstart.value %>
除非我误会,&LT;%=将火在asp.net生命周期的尽头在这种情况下是有用的停止它
Unless I misunderstand, <%= will fire at the very END of the asp.net life cycle stopping it from being useful in this context.
推荐答案
事实证明你确实需要使用&LT; ASP的标签,在
;%#%&GT其他像&LT;%%&GT;
和&LT;%=%&GT;
执行在ASP的结尾。 NET生命周期并获得吐出缓冲区上帝知道在哪里。当使用&LT;%#%&GT;
但是,ASP的控制必须是数据绑定();
在适当的时间。
As it turns out you DO need to use <%# %>
within asp tags as others like <% %>
and <%= %>
execute at the end of the ASP.NET life cycle and get spit out the buffer to god knows where. When using <%# %>
however, the asp control needs to be DataBound();
at the appropriate time.
这自动发生在&LT模拟控制;项目模板过夜。数据绑定()
命令。
这篇关于服务器变量里面没有ASP控制工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!