Link to home
Start Free TrialLog in
Avatar of MikeMCSD
MikeMCSDFlag for United States of America

asked on

Where did the events go?

I've been using VB with visual studio 2003. I'm using C# with visual studio 2005 now.

I can't find the events now.  In VB when I added a control like a button,
I would go into code view and the button name would be on the left drop-down list
and the events on the right. Now, the controls are not listed in code view.
The only way I can figure out how to get the event signature is to double click on the control
in design view.  How do I get the events for a DataList? When I add the control:
<asp:DataList ID="DataList1" OnItemDataBound="????" runat="server"> . . .
I see I can select the events from there . . but how do I implement this?
I'm use to the VB way and this is confusing me. Can anyone shed some light on this?  thanks

SOLUTION
Avatar of Fernando Soto
Fernando Soto
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
ASKER CERTIFIED SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of MikeMCSD

ASKER

Oh, I forgot to say I'm using ASP.NET. sorry about that
From reading this book, it is telling me that the "code-behind" model of .NET 1.1 is no longer being used in place of a "partial class".
It says:
".net 2.0 continues to support original code-behind but it should be used only for preexisting code. Inline or partial class should be used instead".
Isn't this taking a step back? I guess they are doing it for performance reasons.

I also noticed that I don't need to build the project when I make changes to the code.
The code is now compiled with the markup page on the first request.

The new partial class looks like this:

<@Page  . . CodeFile="CategoriesList.ascx.cs" . .
public partial class CategoriesList : System.Web.UI.UserControl


The old code-behind:

<@Page  . .  Src="Default2.aspx.cs" .  .
public class Default2 : System.Web.UI.Page
{
  protected TextBox txt;

So I don't need the "Bin" folder anymore?  Is there no "Debug" and "Release" mode anymore?  These new changes are really screwing me up!

Avatar of TSmooth
TSmooth

Don't get too caught up in the code behind changes. The partial class methodology simply means that the designer generated code can be separated out into it's own file and your code can be it's own vb file. It allows you to span a classes definition across multiple files. Basically, you will still do things the same way.  I noticed at the top, you compared a user control to a page and those are two different things.

The bin folder is still utilized and debug and release modes are still available. If you create a pre-compiled site then your site's dll or dll's will go into the bin folder and depending on the options you choose, the aspx files won't need to be there. There are various options for deploying your website. If you are just developing a true "web site" in ASP.NET 2.0 as opposed to the Web application projects, all of your code files placed in the app_code folder will be compiled for you and intellisense will work within the IDE for you as well.
Thanks.
Can't wait for Visual Studio 2008 to confuse me even more.