|
-
May 28th, 2002, 11:01 PM
#1
Thread Starter
Member
difference between code-behind, and in code
i've been looking at coding in the typical brackets in the webpages (ie. <% %>) compared to using the code-behind method. Sometimes i get different results, using the exact same code.
Is there a difference in where you put it? I really like how the code-behind formats it for me, where in the HTML view, i have to format it... (perhaps i'm just lazy). Or am i just doing something incorrectly?
-
May 29th, 2002, 06:09 AM
#2
Fanatic Member
I place all code/html in one page because I don't have VS.Studio. CodeBehind is too much work without it. I've yet to run into any situation where I can't do something so it doesn't **really** matter where you place the code.
There are differences in how you do some things. The context is different. Calls in the aspx page that work fine, fail in codebehind unless you change it slightly. Nothing major but it's there.
IMHO, CodeBehind is for orgainization. It makes it easier to write/maintain your program if the 2 are seperate. Much cleaner **IF** you have VS.Studio. Makes it a tad annoying if you don't have it(have to combine samples, only so many copies of Notepad I can have open before I get confused, etc).
Overall....if I had VS.Studio, I'd do it all with Codebehind. Most of the books/samples use it and it looks more professional.
John
-
May 29th, 2002, 08:13 AM
#3
I concur with Patooey that the main advantage is organization. As it is easier to keep design in 1 file, and logic in another..
although code behind is not really that hard without VS..
Use textpad instead of notepad Patooey because it keeps seperate files tabulated so its easier to switch between what files you need.
-
May 29th, 2002, 09:09 AM
#4
Thread Starter
Member
ok, then i'm going to have to find my example i was doing, and post it here to see exactly why it wouldn't work.
i believe i made a sub() and tried calling it from another part of the document, and it would work in the .aspx page, but not in the code-behind.
I would prefer the code-behind, since i can keep the coding out of the designer's view...
-
Jun 6th, 2002, 09:10 PM
#5
Addicted Member
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|