Quick Starts - <script> vs code behind

G

Guest

Hi;

Almost all of the Quick Starts show the code in the .aspx file inside a
<script> instead of in a seperate .aspx.cs file. My instinct is that the code
should be in a seperate file to keep the view and the view logic distinct.

Is there a strong argument for combining these in one file? (It may just
feel wrong to me because of years of J2EE/JSP programming where you always
keep them seperate.)
 
G

Guest

hi,

most of the time it is for sample simplification
You then just copy the sample and paste it a blank page and it works
imeddiatly
having it in separte could work also but then its more esay to make mstakes
whith something like namespace of library to include etc....
 
S

Steve C. Orr [MVP, MCSD]

There is not a strong argument for keeping everything in one file, although
some people prefer it, but it's really just their preference.
There's a good reason Visual Studio 2005 uses the code behind model by
default. Code separation is considered a good thing by most experts.
However, if I were writing the quick starts I might consider using the
single page model because it's an easier way to show all the code at once
when trying to teach somebody. That's probably the main reason they chose
that approach for the quick starts.
 
G

Guest

Thank you. I thought that might be it but usually in a basic tutorial they do
everything the "correct" way so I figured better to ask.
 
P

Patrick.O.Ige

I totally agree with you Steve
Patrick

Steve C. Orr said:
There is not a strong argument for keeping everything in one file, although
some people prefer it, but it's really just their preference.
There's a good reason Visual Studio 2005 uses the code behind model by
default. Code separation is considered a good thing by most experts.
However, if I were writing the quick starts I might consider using the
single page model because it's an easier way to show all the code at once
when trying to teach somebody. That's probably the main reason they chose
that approach for the quick starts.
 
H

HongQuan Wu[MSFT]

Hi,

Do you have any other concerns on this issue? Thank you!

Thanks & Regards,

Frederick Wu
Microsoft Online Partner Support

Get Secure! - www.microsoft.com/security

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

=====================================================
Business-Critical Phone Support (BCPS) provides you with technical phone
support at no charge during critical LAN outages or "business down"
situations. This benefit is available 24 hours a day, 7 days a week to all
Microsoft technology partners in the United States and Canada.

This and other support options are available here:

BCPS:
https://partner.microsoft.com/US/technicalsupport/supportoverview/40010469

Others: https://partner.microsoft.com/US/technicalsupport/supportoverview/

If you are outside the United States, please visit our International
Support page:
http://support.microsoft.com/default.aspx?scid=/international.aspx.
=====================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 

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

Members online

Forum statistics

Threads
473,744
Messages
2,569,483
Members
44,902
Latest member
Elena68X5

Latest Threads

Top