473,503 Members | 9,903 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Where to write the code

Jay
Hello everyone,

I just got done taking a small course in ASP.NET and I'm completely sold.
This is amazing compared to original ASP.

My question is about the preferred method of coding the asp pages. We were
taught to write our code behind the page using VS.NET but some books I've
seen have examples where you write the code right on the aspx page.

Is one of these methods more proper than the other, maybe more preferred?

Does anyone know of any pros and cons for each method?

Thanks!

- J
Nov 17 '05 #1
5 1609
One of the worst things about old ASP was that you had to mix presentation
with logic. Messy Messy.
Code behinds files are the solution. Enjoy it.
Books tend to print examples the other way because it's easier to lay it out
that way in a book rather than having 2 separate listings for a single page.
VS.NET pretty much forces you to use code behinds way anyway.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Jay" <je******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello everyone,

I just got done taking a small course in ASP.NET and I'm completely sold.
This is amazing compared to original ASP.

My question is about the preferred method of coding the asp pages. We were
taught to write our code behind the page using VS.NET but some books I've
seen have examples where you write the code right on the aspx page.

Is one of these methods more proper than the other, maybe more preferred?

Does anyone know of any pros and cons for each method?

Thanks!

- J

Nov 17 '05 #2
CT
I'm with Steve on this one; use code behind as it is so much easier to
maintain.

--
Carsten Thomsen
Enterprise Development with Visual Studio .NET, UML, and MSF
http://www.apress.com/book/bookDisplay.html?bID=105
"Jay" <je******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello everyone,

I just got done taking a small course in ASP.NET and I'm completely sold.
This is amazing compared to original ASP.

My question is about the preferred method of coding the asp pages. We were
taught to write our code behind the page using VS.NET but some books I've
seen have examples where you write the code right on the aspx page.

Is one of these methods more proper than the other, maybe more preferred?

Does anyone know of any pros and cons for each method?

Thanks!

- J

Nov 17 '05 #3
I would say everything what goes to presentation layer goes into aspx.
Business logic goes to DLL.
Now the question is where Page::OnLoad belogs?

I say it's a presentation layer and the best place for it in the aspx.
George, MSCD ( I like my fancy title).

"Steve C. Orr, MCSD" <St***@Orr.net> wrote in message
news:u9**************@TK2MSFTNGP11.phx.gbl...
One of the worst things about old ASP was that you had to mix presentation
with logic. Messy Messy.
Code behinds files are the solution. Enjoy it.
Books tend to print examples the other way because it's easier to lay it out that way in a book rather than having 2 separate listings for a single page. VS.NET pretty much forces you to use code behinds way anyway.

--
I hope this helps,
Steve C. Orr, MCSD
http://Steve.Orr.net
"Jay" <je******@yahoo.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
Hello everyone,

I just got done taking a small course in ASP.NET and I'm completely sold. This is amazing compared to original ASP.

My question is about the preferred method of coding the asp pages. We were taught to write our code behind the page using VS.NET but some books I've seen have examples where you write the code right on the aspx page.

Is one of these methods more proper than the other, maybe more preferred?
Does anyone know of any pros and cons for each method?

Thanks!

- J


Nov 17 '05 #4
I would say everything code-wise is best in code-behind. You can still
seperate your presentation and business logic very cleanly using
code-behind, and the presentation code is much cleaner then it would in
page.

With code-behind it is also much simpler to write code (even presentation
code) that is shared across many pages.

Todd Thompson
Nov 17 '05 #5
NO question - BEHIND

"Jay" <je******@yahoo.com> wrote in message
news:#Y**************@TK2MSFTNGP12.phx.gbl...
Hello everyone,

I just got done taking a small course in ASP.NET and I'm completely sold.
This is amazing compared to original ASP.

My question is about the preferred method of coding the asp pages. We were
taught to write our code behind the page using VS.NET but some books I've
seen have examples where you write the code right on the aspx page.

Is one of these methods more proper than the other, maybe more preferred?

Does anyone know of any pros and cons for each method?

Thanks!

- J

Nov 17 '05 #6

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

15
3274
by: Viviana Vc | last post by:
How can I programatically do the equivalent of the following: cacls "C:\Program Files\test" /T /G Everyone:f ? Thanks, Viv
3
2652
by: Rajesh | last post by:
Hi, I am using iplanet webserver 4.1. I want to call a java class from ssjs file. But I am not getting the result. I have created a java class file and put it in the folder...
7
3032
by: Britney | last post by:
Original code: this.oleDbSelectCommand1.CommandText = "SELECT TOP 100 user_id, password, nick_name, sex, age, has_picture, city, state, " + "country FROM dbo.users WHERE (has_picture = ?) AND (sex...
1
3395
by: rdemyan via AccessMonster.com | last post by:
I'm trying to implement a licensing scheme. There are three types of licenses: Trial - good for 30 to 60 days Interim - good for 1 year Fully Paid - no expiration Everything is working fine...
11
6601
by: Yelena Varshal via AccessMonster.com | last post by:
Hello, I have a problem with one of msaccess.exe API calls that work on my desctop but does not work on the laptop from within MS ACCESS. There is a lot of differences between 2 computers...
8
2064
by: Mr Flibble | last post by:
I can embed code within <% %> within my page or put it in the .aspx.cs file (perhaps within the load method). What are the advantages over each? Background: I have some XML and I want to...
8
3464
by: chrisdavis | last post by:
I'm trying to filter by query or put those values in a distinct query in a where clause in some sort of list that it goes through but NOT at the same time. Example: ROW1 ROW2 ROW3 ROW4 ,...
7
2330
by: neelesh kumar | last post by:
sir, now when i open the database tools menu is not coming.i want that only. but if i open my database by pressing shift button tools menu is coming.i have a code to disable the shift key where i...
41
18063
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
37
2555
by: Phlip | last post by:
1230987za wrote: Kanze is a classically-trained "unit tester". In some circles "unit" is a QA concept - specifically, if a test fails, you only need to inspect one unit. So "units" are...
0
7207
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7095
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7361
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
1
7015
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7470
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5602
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5026
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3173
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
749
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.