Event Procedures and Methods

K

Kuldeep

Hi All,

Could anybody give me some ideas on the advantages and disadvantages when it
comes to having Event Procedures and Methods in .aspx page rather than
having them in .aspx.cs/.aspx.vb

Regards,
Kuldeep
 
K

Kerem OZMAN

Based on my personal experience it's better to use codebehind pages (i.e.
aspx.vb and aspx.cs) since it helps you to seperate the code and static
content. And prior to Visual Studio 2005 you do not have some IDE features
like intellisense when you are writing inline code (i.e. ASP.NET code within
an aspx file.) But in some special cases (like data binding some controls
together or catching events from objects within a DataGrid column -VS.NET
2003- etc. you might want to use inline code or tag-based attributes and
events of controls. But as I said they are special cases and they're not
like that you are writing alll the code inline.) Also theree's a new web
site project model with Visual Studio 2005 so that your code changes are
reflected to your website almost instantly. Prior to Visual Studio 2005
default project model for web applications (for Visual Studio.NET) was
precompiling all your codebehind pages inside of an assembly and that was
causing some problems with deployment and updates sometimes. But Visual
Studio 2005 has support for intellisense within aspx files and a new project
model. So in short, I like my code tidy and my static content seperated but
it's always up to you to decide. Oh and a side note, you can bring back the
old web application model (precompiled) to Visual Studio 2005 with a small
update from Microsoft if you wish.It has a slight advandatge of hiding your
VB or C# code within an assembly but remember that there are great
decompilers for C# out there.Link for web application project model:
http://msdn.microsoft.com/asp.net/reference/infrastructure/wap/default.aspx
 

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,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top