473,395 Members | 1,624 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Visual Studio 2005 (Beta 1) and auto-generated partial classes

Long, annoying story:

I'm having trouble viewing the auto-generated code of an aspx web form.

There doesn't seem to be a "show all" (or "reveal all" or anything like
that) button in the solution explorer window. All I can see in the
solution explorer, for a web site type of project, are the normal .aspx
and .aspx.cs files (as well as standard things like .html, etc...).

If I open an aspx.cs file, I can't "go to definition" of the partial
class.

I've tried short cicuiting this by creating a simple <asp:label>
control. When I go into the aspx.cs file, the control pop-ups up in
intellisense and I can use it normally. So I know that it's being
defined _somewhere_.

If I highlight the name of the control, right click, and choose "go to
definition" I get a wonderful pop-up telling me that the definition is
hidden! (Gee wiz Microsoft, thanks for providing the helmet, but
sometimes I need to take it off to scratch my head!)

I get a similar result if I open the object browser and search for,
say, Login_aspx. The results pane shows 2 occurences, one in the
aspx.cs
file and another in the aspx page. If I select the aspx.cs reference,
it takes me to the file; if I select the aspx reference, it gives me
that wonderful "it's hidden!" pop-up.

I figure this has got to be a setting somewhere, I just don't know what
it is and I'm having trouble finding it.

Help?

(Thanks in advance)

Nov 19 '05 #1
6 1260
Hopefully this article [1] will help bring more understanding of partial
classes.

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

[1] http://www.ondotnet.com/pub/a/dotnet...alclasses.html


"C.Batt" <cu*********@gmail.com> wrote in message
news:11**********************@l41g2000cwc.googlegr oups.com...
Long, annoying story:

I'm having trouble viewing the auto-generated code of an aspx web form.

There doesn't seem to be a "show all" (or "reveal all" or anything like
that) button in the solution explorer window. All I can see in the
solution explorer, for a web site type of project, are the normal .aspx
and .aspx.cs files (as well as standard things like .html, etc...).

If I open an aspx.cs file, I can't "go to definition" of the partial
class.

I've tried short cicuiting this by creating a simple <asp:label>
control. When I go into the aspx.cs file, the control pop-ups up in
intellisense and I can use it normally. So I know that it's being
defined _somewhere_.

If I highlight the name of the control, right click, and choose "go to
definition" I get a wonderful pop-up telling me that the definition is
hidden! (Gee wiz Microsoft, thanks for providing the helmet, but
sometimes I need to take it off to scratch my head!)

I get a similar result if I open the object browser and search for,
say, Login_aspx. The results pane shows 2 occurences, one in the
aspx.cs
file and another in the aspx page. If I select the aspx.cs reference,
it takes me to the file; if I select the aspx reference, it gives me
that wonderful "it's hidden!" pop-up.

I figure this has got to be a setting somewhere, I just don't know what
it is and I'm having trouble finding it.

Help?

(Thanks in advance)

Nov 19 '05 #2
Kinda funny, but after I posted my rant/question I was playing around
with code in the aspx. I noticed that if I added a control, whether
through the designer or in the markup, the object was accessible
immediately in the code file. I just guessed that something was
defining the object "somewhere" automagically, for me.

This article seems to confirm that and thus cut through my confusion.
Cool feature, but very strange coming from many years of hand-coding
everything. Great amounts of frustration.

Informative article. Thanks.

Nov 19 '05 #3
We have to take things for granted now. When they say...

"All of the information that would go into the designer class is implied in
the .aspx file."

.... we must tell ourselves "we are monkeys too stupid to know what is in our
best interest and do not need to see any source code"

I've downloaded but haven't installed VS2005 Beta 2 yet but I did not and do
not like the fact that partial classes also hide the signature for all
controls. When I want to know the accessor method and name of a control I
have to waste time moving back and forth from the editor to the designer to
look into the properties pane. TARFU.

I sent a request to MSDN Product Feedback [1] suggesting control signatures
be retained in the source of the partial class and could be emitted as
comments within a #region but I do not know if they decided to adopt this
common sense compromise or if we have to waste a lot of time moving back and
forth.

<%= Clinton

[1] http://lab.msdn.microsoft.com/Produc...k/Default.aspx

"C.Batt" <cu*********@gmail.com> wrote in message
news:11**********************@g14g2000cwa.googlegr oups.com...
Kinda funny, but after I posted my rant/question I was playing around
with code in the aspx. I noticed that if I added a control, whether
through the designer or in the markup, the object was accessible
immediately in the code file. I just guessed that something was
defining the object "somewhere" automagically, for me.

This article seems to confirm that and thus cut through my confusion.
Cool feature, but very strange coming from many years of hand-coding
everything. Great amounts of frustration.

Informative article. Thanks.

Nov 19 '05 #4
I'm not sure it's that bad, but I catch your drift. I would hope to
see Web forms and Windows forms behaved similarly in VS 2005. What I
mean is that it would be nice to have an explicitly generated
partial-class "root" (for lack of a better word) file like the one
generated for Windows forms.

Is this changed at all in Beta 2?

In the defence of the current model, I am quite impressed by how well
it does keep the markup and the code-behind in sync without
intervention. Adding a control to the markup and specifying properties
and events auto-magically and transparently (invisibly?) adds the
proper object instantiation and event delegation code to the project.
In some ways this is very cool, but at the same time it's also pretty
frightening, or at least was in my case, because it's not consistent
with the Win-forms model nor consistent with how it was done in the
past. I don't like to have things hidden from me, and I'm sure that
I'm not the only developer who thinks like this.

Options, MS. Lots and lots of options to customize the environment to
suit our tastes. Giving control to developers makes developers happy.

Nov 19 '05 #5
> This article seems to confirm that and thus cut through my confusion.
Cool feature, but very strange coming from many years of hand-coding
everything. Great amounts of frustration.


Well, the hand-coding (by manual field declarations in the codebehind) caused
endless frustration because the inherently broken inheritance model for codebehind.
The declaration in the ASPX should be sufficient, and it is, given how ASP.NET
is using that markup to provide the control for you. It's now "hidden" in
ASP.NET 2.0 in so far as they're trying to fix the original problem from
v1.1.

I've commented on this elsewhere, but given how in VS.NET 2005 there's now
adequate tool support (mainly intellisense) for developing single ASPX files
(without codebehind) I won't be using codebehind anymore for my projects.
It's quite refreshing to work without codebehind.

-Brock
DevelopMentor
http://staff.develop.com/ballen


Nov 19 '05 #6
> In the defence of the current model, I am quite impressed by how well
it does keep the markup and the code-behind in sync without
intervention.


Well, it doesn't though. If you use drag and drop, then perhaps it seems
fine, but given how brutal drag and drop is on the HTML I never use it. I
only ever work in the HTML mode. And when you do that, the IDE doesn't synch
up the codebehind unless you switch to design view (which reformats the HTML).
Also ever try making the <body runat=server>? Or adding a <head runat=server>?
It doesn't do those either.

As I just said in another post in this thread, with VS.NET 2005 I won't be
using codebehind anymore.

-Brock
DevelopMentor
http://staff.develop.com/ballen


Nov 19 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

11
by: DraguVaso | last post by:
Hi, I want to download Visual Studio 2005 Beta 1 Refresh, but on the site of Microsoft they say it is only for MSDN subscribers? what is a MSDN subscriber and how do I get it? When I try to...
2
by: Andy | last post by:
Hi all, I'm not sure if this is the right group, but.... Have just got my Beta Version of VS 2005, and have upgraded a small calendar project with the upgrade wizard. I have realised that...
8
by: Dave Raskin | last post by:
Does anyone have a decent idea of when Visual Studio 2005 Beta 2 comes out?
3
by: Benjamin.Nitschke | last post by:
Today I installed Microsoft Visual Studio 2005 Beta 2 from the Visual Studio Beta Experience Kit. After installing (which takes way to long) when I open Visual Studio 2005 I only get a message box...
2
by: bor_kev | last post by:
Hi! Now, I have to develop under Microsoft Visual Studio 2005 Beta, while I used to develop under Visual C++ .NET. That means I have to migrate all my former projects into this environment. The...
4
by: Charts | last post by:
6/23/05 ..NET Development\Framework\dotnet.framework.aspnet Visual Studio 2005 Beta 2 project cannot work in IIS virtual directory I used Visual Studio 2005 Beta 2 to build a simple new...
3
by: Shapper | last post by:
Hello, I am starting 2 new projects to deliver in January 2006. I want to create them in Asp.Net 2.0 using Visual Studio 2005. All my clients web sites are Visual Studio 2003 projects in...
0
by: Dr. Zharkov | last post by:
Hello. To see the graphics of technology DirectX 9.0 SDK Update - June 2005 in project Visual Basic, WindowsApplication1 from Visual Studio 2005 Beta 1, in file My Project, MyApplication.vb in a...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.