Obsure ASP.Net Bug?
-
I was getting some weird compiler errors and spent about half an hour trying to figure them out. Long story short, this will not compile in ASP.Net:
<%@ Page Language="vb" %>
<script runat="server">
Protected Sub Test()
Dim s As String = "</script>"
End Sub
</script>Without opening Visual Studio, any guesses as to why it doesn't compile? I've already figured it out, but I don't want to spoil the surprise. :)
-
I was getting some weird compiler errors and spent about half an hour trying to figure them out. Long story short, this will not compile in ASP.Net:
<%@ Page Language="vb" %>
<script runat="server">
Protected Sub Test()
Dim s As String = "</script>"
End Sub
</script>Without opening Visual Studio, any guesses as to why it doesn't compile? I've already figured it out, but I don't want to spoil the surprise. :)
-
I was getting some weird compiler errors and spent about half an hour trying to figure them out. Long story short, this will not compile in ASP.Net:
<%@ Page Language="vb" %>
<script runat="server">
Protected Sub Test()
Dim s As String = "</script>"
End Sub
</script>Without opening Visual Studio, any guesses as to why it doesn't compile? I've already figured it out, but I don't want to spoil the surprise. :)
-
Is it because Visual Studio has realised the stupidity of VB and now only compiles C#? :laugh:
return 5;
Weak...:(
-
Weak...:(
-
Yeah, I was thinking of reporting this to Microsoft Connect. Seems like a bug in the parser.
-
Yeah, I was thinking of reporting this to Microsoft Connect. Seems like a bug in the parser.
They could really do with a good review of the asp editor in general. it is very annoying how it formats code when you start using if/else statements. Also, something like the following causes warnings (even if it is bad coding)
<% if(true){ %>
It is true I tell you!<% } else { %>
You will never here from me!
<% } %>return 5;
-
They could really do with a good review of the asp editor in general. it is very annoying how it formats code when you start using if/else statements. Also, something like the following causes warnings (even if it is bad coding)
<% if(true){ %>
It is true I tell you!<% } else { %>
You will never here from me!
<% } %>return 5;
What warning does it give? I would think it's a good thing that it warns you of unreachable code.
-
What warning does it give? I would think it's a good thing that it warns you of unreachable code.
-
Oh, I gotcha. Yeah, that is annoying. I usually use an asp:Literal tag to get around that.