Name '___o' is not declared

  • Thread starter Thread starter Fred Flintstone
  • Start date Start date
F

Fred Flintstone

What is this? I can't get rid of it. I've seen articles that say I
should add something like <% ="" %> at the top of the page and I've
done that, but these errors won't go away and they actually appear to
the user on the website.

How do I get rid of these errors? (asp.net v2)
Thanks
 
I checked the page, it tells me to use <% ="" %> and the errors
persist. (it's placed right after the body tag).

Where are they used? The entire site is in 2 languages. All
graphics, all text and any other elements (buttons, etc) need decision
makers in the code;

<% if session("Language") = "E" then %>
English Blurb <IMG SRC="EnglishImage.jpg">
<% else %>
French Blurb <IMG SRC="FrenchImage.jpg">
<% end if %>

What would be the 'better ' way?
Thanks for the reply
 
Check out:
http://blogs.msdn.com/mikhailarkhipov/archive/2006/04/20/580165.aspx

As far as I'm concerned, the real solution though is not to use <% %> in
your pages. Where/why are you using them? There are very few good reasons to
use <% %> in ASP.NET.

no offence, but that's not true at all. There are some cases when you
can't simply insert a web form control into a page to solve a particular
problem.


e.g.
in a datalist itemtemplate I have:

<ItemTemplate>
<table>
<tr onclick='toggle(<%# DataBinder.Eval(Container.DataItem, "id")%>)' >
....

I can't simply stick a 'literal' into the <tr> tag .. in addition I'm
not going render the table through a literal since that makes it
difficult for the designers to work on the html (without having to edit
it through code)

I can think of 100s of reasons for using <% %> in asp.net
 
Databinding and code evaluation are totally different things. They serve
different purposes, are executed at different points in the page lifecycles,
and one is deprecated whle the other s not.


<%# BIND STUFF %> is fine

<% dim x as string = Request.Querystring("asdassd")
if (x = "asdas") then
....
%>

is not.

The only time I've used <% %> is when I'm interacting with javascrit and I
want to do:

var c = document.getElementById("<%=control.ClientId%>);

And by the way, you CAN stick a literal in the <td> tag and hook into the
DataBinding and DataCreated events...which you SHOULD do for anything but
the simplest of databinding.

Karl
 
Cool, I see what you're saying. There's only 2 problems:

- You can't use localization for Canadian French. French Canadians
will flip out completely if even one accent is off and they all agree
that the MS implementation of Canadian French is not entirely correct.
We have to use the text they send us or they lose it. I mean, flaming
four letter emails if one character is off. I do use localization but
only for date and time formats.

- I can't re-write the entire application to simply solve the ___o
problem.

- Those docs are all in C#, I'm in vb.

I'll repost the question.
Thanks anyways.
 
Fred:

Those 3 documents were written specifically based on my experience creating
multilingual sites for the Canadian Government (as well as a number of
triligual sites). You obviously brushed over it very quickly - there is no
automatic translation going on...the cultures are just used to identify
which xml file/database to pull the CUSTOM content from. Localization
doesn't mean automatic translation...localization is exactly what you are
doing...targetting for specific locales, your way just isn't very good.

2 - The application was poorly written...whether you wrote it or someone
else did, .NET is being used in a poor way.

3 - The examples are fully available in VB.NET. The difference between C#
and VB.NET is so minimal that all developers should be able to easily pick
up either language within hours.

Best of luck with your problem,

Karl
 
Back
Top