Simple question to the group...

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...
 
B

bruce barker

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)
 
A

Andrew Morton

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
 
H

Hillbilly

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.
 
M

Michael Earls

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. ;)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top