锘??xml version="1.0" encoding="utf-8" standalone="yes"?>亚洲激情在线观看,91日韩一区二区三区,国产日韩在线一区二区三区http://www.aygfsteel.com/unilobster/articles/346408.html娓擱洴娓擱洴Wed, 16 Mar 2011 08:16:00 GMThttp://www.aygfsteel.com/unilobster/articles/346408.htmlhttp://www.aygfsteel.com/unilobster/comments/346408.htmlhttp://www.aygfsteel.com/unilobster/articles/346408.html#Feedback0http://www.aygfsteel.com/unilobster/comments/commentRss/346408.htmlhttp://www.aygfsteel.com/unilobster/services/trackbacks/346408.html

FWD: http://stackoverflow.com/questions/750902/how-do-i-get-rid-of-o-is-not-declared

I've found the answer on the .net forums. It contains a good explanation of why ASP.Net is acting the way it is:

[quote]

We have finally obtained reliable repro and identified the underlying issue. A trivial repro looks like this:

 <% if (true) { %>
<%=1%>
<% } %>
<%=2%>

In order to provide intellisense in <%= %> blocks at design time, ASP.NET generates assignment to a temporary __o variable and language (VB or C#) then provide the intellisense for the variable. That is done when page compiler sees the first <%= ... %> block. But here, the block is inside the if, so after the if closes, the variable goes out of scope. We end up generating something like this:

   if (true) { 
       
object @__o;
       
@__o = 1;
   
}
   
@__o = 2;

The workaround is to add a dummy expression early in the page. E.g. <%="" %>. This will not render anything, and it will make sure that __o is declared top level in the Render method, before any potential ‘if’ (or other scoping) statement.

[/quote]

An alternative solution is to simply use

<% response.write(var) %>

instead of

<%= var %>
link|edit|



娓擱洴 2011-03-16 16:16 鍙戣〃璇勮
]]>
主站蜘蛛池模板: 思茅市| 珲春市| 新余市| 上思县| 辰溪县| 曲麻莱县| 余干县| 无为县| 建阳市| 德兴市| 广德县| 盐城市| 关岭| 皋兰县| 宾阳县| 兴安县| 浠水县| 高淳县| 碌曲县| 赤壁市| 宁晋县| 英德市| 高碑店市| 绥江县| 海阳市| 马尔康县| 岳西县| 上林县| 府谷县| 阿尔山市| 安顺市| 育儿| 姜堰市| 长垣县| 宁远县| 舞钢市| 华容县| 新泰市| 洪泽县| 鄱阳县| 伊春市|