Wrox Programmer Forums
|
BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3
This is the forum to discuss the Wrox book Beginning ASP.NET 3.5: In C# and VB by Imar Spaanjaars; ISBN: 9780470187593
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 13th, 2008, 10:30 AM
Registered User
 
Join Date: Feb 2008
Posts: 6
Thanks: 0
Thanked 0 Times in 0 Posts
Default Code Behind file

Hi.

I just finished Chapter 1 and I am greatly looking forward to the next chapter. However, just one outstanding question remains:

In Figure 1-4 I see "Default.aspx.cs" under the Default.aspx file. Is this the file where the programming code (C#, in this example) is placed if we choose to "place code in a separate file, called the Code Behind file"?

Thanks!

~Peter
 
Old March 13th, 2008, 10:44 AM
Wrox Author
 
Join Date: Oct 2005
Posts: 4,104
Thanks: 1
Thanked 64 Times in 64 Posts
Send a message via AIM to dparsons
Default

Yes. As you mentioned, if you check the box "Place code in a seperate file" when adding pages to your application the .cs or .vb files are added as sub elements of your .aspx file and are known as code behind files.

hth.
-Doug

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
.: Wrox Technical Editor / Author :.
Wrox Books 24 x 7
================================================== =========
 
Old March 13th, 2008, 10:47 AM
planoie's Avatar
Friend of Wrox
 
Join Date: Aug 2003
Posts: 5,407
Thanks: 0
Thanked 16 Times in 16 Posts
Default

Yes. Any file that is names like this: <aspx/ascx file name>.cs (or .vb) is the codebehind file for the page when using the Code Behind selection.

-Peter
peterlanoie.blog
 
Old March 14th, 2008, 04:45 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi Peter,

As Doug and Peter pointed out, you are right. That's indeed the code behind file you see.

The section "Working with Web Forms", in chapter 2 (starting at page 47) digs much deeper into web forms and code behind files and shows you the differences between pages with code behind and pages with in-line code.

Cheers,

Imar


---------------------------------------
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Everyone is unique, except for me.
Author of ASP.NET 2.0 Instant Results and Beginning Dreamweaver MX / MX 2004





Similar Threads
Thread Thread Starter Forum Replies Last Post
here is my code c++ file handling amahja56 C++ Programming 2 November 23rd, 2007 07:25 AM
VB: .Exe file, serial code and activation code ivanlaw Pro VB 6 8 July 6th, 2007 05:44 AM
transfearing code to aspx file from vb file alyeng2000 ASP.NET 1.0 and 1.1 Professional 1 December 15th, 2003 11:12 AM
Move a file via code fordrs3 VB How-To 2 June 26th, 2003 01:04 PM
Disappearing code file!? jboland Crystal Reports 0 June 25th, 2003 05:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.