no code in webform using vs.net, but in webform using notepad

T

timmso

If I create a webform in notepad (save it with an .aspx extension), I can
see the VB.Net code along with the ASP.Net code in one file.

If I create an Asp.Net web application and add a web form using VS.Net, only
the Asp.Net code is behind the web form.

Where is the VB.Net code stored? And why is it stored differently than the
first way I mentioned?

Thanks.
 
A

Alex Papadimoulis

Hi Timmso,

VS.Net utilizes the concept of "code behind", where the code/logic to run a
webpage is stored in a class that inherits from the Page class. Your ASPX
page then inherits from this codebehind class.

The code for your file is stored in an aspx.vb file, in the same folder.
Try Project>Show All Files. The .vb files are then compiled into a DLL, and
do not need to be uploaded to the production machine.

IMO, "codebehind" is an ok idea in concept, but is doesn't work well in
practice in most scenarios -- a change to the .vb file requires rebuilding
the application. I've found it best to build middle-tier objects in vs.net,
and use dreamweaver or webmatrix to develop the application. Neither use
codebehind.

Alex Papadimoulis
 

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,755
Messages
2,569,537
Members
45,020
Latest member
GenesisGai

Latest Threads

Top