In my aspx code I have something like this
if(AnId == <%=MyCodebehindObject.MyId%>)
{
// stuff
}
The code is working: I can get the value from the codebehind variable. However, I'm getting a "Syntax error" warning right at the end of the first line.
I can "fixed it" by enclosing the variable with quotes, but this will make my variable a string, and I'm expecting an int. That will work just fine, the javascript will cast it for comparison, but I think that is just stupid and I was trying to find the write way of doing it.
Any ideas?
MyCodebehindObject.MyIDWhat is this..? any Control's ID..?