Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Simple question to the group...

Reply
Thread Tools

Simple question to the group...

 
 
Blue Streak
Guest
Posts: n/a
 
      03-12-2009
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...
 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      03-12-2009
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 Streak wrote:
> 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...

 
Reply With Quote
 
 
 
 
Andrew Morton
Guest
Posts: n/a
 
      03-12-2009
Blue Streak wrote:
> 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


 
Reply With Quote
 
Hillbilly
Guest
Posts: n/a
 
      03-12-2009
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.


"Andrew Morton" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> Blue Streak wrote:
>> 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
>


 
Reply With Quote
 
Michael Earls
Guest
Posts: n/a
 
      03-24-2009
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.

"Hillbilly" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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.
>
>
> "Andrew Morton" <(E-Mail Removed)> wrote in message
> news:(E-Mail Removed)...
>> Blue Streak wrote:
>>> 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
>>

>


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Plz, a simple answer to a simple question about IP addresses MeekiMoo Computer Support 0 07-28-2009 08:10 AM
Simple region code question... simple answer?? joseph.greer@gmail.com DVD Video 7 01-26-2007 09:07 PM
Simple Question - Simple Answer? Daniel Frey XML 4 01-12-2005 04:25 PM
Re: Simple Simple question!!! Kevin Spencer ASP .Net 0 06-25-2004 05:25 PM
Re: Simple Simple question!!! ashelley@inlandkwpp.com ASP .Net 0 06-25-2004 04:18 PM



Advertisments