Name '__o' not declared!?!?!

lunedì 17 novembre 2008 - 17.08

augusto890 Profilo | Junior Member

Ciao a tutti ragazzi...come avete letto nel titolo mi appare quell'errore praticamente ovunque...non mi ha mai dato problemi...ma oggi ho 98 errori di quel tipo...e praticamente mi blocca il programma...qualcuno sa darmi una soluzione??? che errore è???

Anonimo Profilo | Senior Member

Ti cito un post che puoi trovare a questo url:
http://forums.asp.net/p/923745/1266105.aspx

[citazione]
[...]
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.
[/citazione]

augusto890 Profilo | Junior Member

L'ho già trovato anke io quel post...ho eseguito.-..ma non è cambiato nnt...
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2013
Running on Windows Server 2008 R2 Enterprise, SQL Server 2008 & ASP.NET 3.5