473,657 Members | 2,517 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 1615
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******** ********@TK2MSF TNGP12.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******** ********@TK2MSF TNGP12.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.ne t> wrote in message
news:u9******** ******@TK2MSFTN GP11.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******** ********@TK2MSF TNGP12.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******** ******@TK2MSFTN GP12.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
3309
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
2657
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 <Server>\Netscape\Server4\bin\https\jar folder. But I am not sure whether it is the right location to put the class file. Also I would like to know how to put the class file in jar format. The Java file and the ssjs file code given below. Java part package pdfbase;
7
3038
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 = ?) ORDER BY age " this.oleDbSelectCommand1.Parameters.Add(new System.Data.OleDb.OleDbParameter("has_picture", System.Data.OleDb.OleDbType.Boolean, 1, "has_picture")); this.oleDbSelectCommand1.Parameters.Add(new...
1
3400
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 and I've even implemented a registration system where the users can upgrade by just receiving a code from me.
11
6626
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 including one running Office 2000 and another running Office 2003. This code was created by a previous developer. I need to find the description and parameters of the API calls. I found the article ...
8
2076
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 display it in some tables. In my opinion I can either loop through some XML data and use Repsonse.write or some other mechanism to populate a table, OR, I can loop through it via the load method of the associated .aspx.cs file and use the...
8
3475
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 , etc. I want to go to the first row, do a WHERE statement, return the
7
2337
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 have to write the code. where is the database property allowbypassshiftkey.i didnt find that where i have to write the shiftkey disable code
41
18161
by: Miroslaw Makowiecki | last post by:
Where can I download Comeau compiler as a trial version? Thanks in advice.
37
2589
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 "things which are clearly delimited and accessible to inspection". That should map onto C++ classes - specifically due to overlapping requirements. C++ classes _should_ be "things which are clearly delimited and accessible to inspection". Yet...
0
8310
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8827
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
8503
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8605
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7333
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6167
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
4158
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1957
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1620
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.