Simple question to the group...

  • Thread starter Thread starter Blue Streak
  • Start date Start date
B

Blue Streak

What is the difference between having code in an ASPX page like this:

<script language="VB" runat="server">
.... .NET code here...
</script>

vs.

<%
.... .NET code here...
%>

TIA...
 
whether the code is defined in a method, or outside a method in the page
source code. don't know vb but in c# its:

class mypage
{

// runat server code goes here



void createobjmodel()
{
// createParsedObjectsBefore
// <% code %>
// createParesedObjectsAfter
// <% more code %>
}
}


this usually means that <script runat=server> can only have methods,
class variables and properties. <% %> can only have inline code (what is
legal inside a method.


-- bruce (sqlwork.com)
 
Blue said:
What is the difference between having code in an ASPX page like this:

<script language="VB" runat="server">
... .NET code here...
</script>

vs.

<%
... .NET code here...
%>

Think about how easy it is going to be to maintain the page, looking through
all the code interspersed with html, and getting all the <% and %> matched.

Then change to using code-behind rather than either of the above :-)

Andrew
 
Until we take a look at the ASP.NET MVC architecture which takes us
backwards in time to embed code in HTML all over again as we did in ASP.
 
MVC will not require any "code" on the page. What little markup you _will_
have to write will drastically reduce the amount of ASPX markup you'll have.
Turn the volume down on the FUD a little. ;)
 
Back
Top