Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

"__o" is not declared in Visual Studio 2008 doing ASP.NET

I have been getting this annoying error/bug in Visual Studio 2008 quite a bit when doing ASP.NET MVC.

"__o" is not declared

"__o" is not declared

What is the problem, and how can I fix it?

like image 892
Kjensen Avatar asked Jun 10 '09 13:06

Kjensen


1 Answers

Just add this on the page at the top:

<%="" %>

...So now my ASP.Net content placeholder begins like this:

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<%="" %>

Quote from: Mikhail Arkhipov (MSFT)'s WebLog

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 when you type in the <%= %> block, similarly to what happens when you type x=.

like image 71
Kjensen Avatar answered Oct 04 '22 21:10

Kjensen