How to look system generated codes in VS2005 ASPNET project

G

Guest

I recently upgraded to VS2005. I noticed that in ASP.NET project, the system
generated codes are missing from default.aspx.cs file. While I used to be
able to see it in VS2003 project. Now, if I added a SQLSource control for
example, I no longer can see system generated code, which could be very
valuable for debugging. I know VS2005 use partial class to hide system
generated code. However how can I see it when I need?
Thanks,
Charts
 
S

Steven Cheng[MSFT]

Hi Charts,

Welcome to the ASPNET newsgroup.

As for the runtime generated code and assemblies you mentioned, most of
them are not business or code logic specific , so ASP.NET 2.0 encapsulate
them for us. For Data Source Controls, those code like data connection
establishing, query data are all encapsulated, so we no longer need to
intercept into them. For page's dynamic generated code(from aspx templte),
there is no longer temp source file in the Temporary ASP.NET folder,
however, we can still find the dynamic generated assemblies there.
Therefore, if you do want to look into the autogeneratd code, you can use
some dasm tools like reflector to inspect those assemblies under the
temporary ASP.NET folder:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
G

Guest

Thanks Steven,
Another related question is that it is used to be easy to locate the control
events in VS2003 ASPNET project. For example, you can select an object (e.g.,
label) on the left dropdown list, in the right dropdown, you can see all the
events for that object. I could locate that feature in VS2005 ASPNET project.
Please advice.
Thanks,
Charts
 
S

Steven Cheng[MSFT]

Thanks for your response Charts,

As for the lookingup events of ASP.NET webcontrols in VS 2005 ide, due to
the new compilation model in ASP.NET 2.0, the VS 2005 ide's support on this
is also a bit different. In asp.net 1.1/vs 2003, all the control member
variables are explicitly declared in codebehind class and event handler
wireup code are generated and put in "InitializeComponents" function, so
the IDE will also support select control member and lookup event list in
the dropdownlist. However, in ASP.NET 2.0, the new compilation model use
partial class to help greatly separate the UI part from the code logic, and
control members are not longer needed (explictly declared in codebehind
class), their will be dynamically generated and compiled from aspx
template.... And all the event wireup code are also autogenerated and
compiled. So in ASP.NET 2.0/VS 2005, we can lookup events or registering
event handler for controls through the following means:

1. Open page in design-view, select the certain control on the page, in the
Property Grid , click "events" tab, we can manage the control's events
here(the same with ASP.NET 1.1/VS 2003)

2. If we have already define event handler functions in code behind page
class, we can switch to html source view and type space in control's begin
tag, the IDE will also dislay all the properties (include events) in the
intellisense window.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

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,774
Messages
2,569,598
Members
45,151
Latest member
JaclynMarl
Top