Code blocks are not supported in this context

  • Thread starter Thread starter John Cantley
  • Start date Start date
J

John Cantley

What does this mean, have been doing services and windows apps for awhile
now, don't remember doing anything special to get them to work

tried
<script runat="server"> or whatever it was
string sContent;
sContent = GetContent("Default");
Response.Write(sContent)
</script>

<%
string sContent;
sContent = GetContent("Default");
Response.Write(sContent)
%>

GetContent is a declared this way public string GetContent(string pPage)

Am I doing something wrong or not have something set?

John
 
The ASP.Net Page class is a class. You can't just put a block of code
anywhere you want to in a class. It has to go inside a function, such as the
Page_Load Event Handler.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.
 
Back
Top