473,396 Members | 1,998 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,396 software developers and data experts.

Adding new controls to upgraded pages

I upgraded a web application into a VS 2005/.NET 2.0 Web Application Project
(as opposed to a Website project), but did not set the pages to be partial
classes.

Looking at the code behind, you can see the declarations of all the controls
as it was in Visual Studio 2003. But when I add a new control, VS doesn't add
the new declare in the code behind, and before you can reference the control,
you manually have to add the declaration in the code behind.

I understand if the class was a partial class, but I don't understand why
this is happening. Is this correct? Is this the way that VS handles the
addition of controls in a Web Application Project?
Mar 14 '07 #1
4 1052
before you can reference the control,
you manually have to add the declaration in the code behind.
It is wrong. You do not need to add the declaration. Are you sure you are
using partial classes to code behind?

Mar 14 '07 #2
Are you sure you are using partial classes to code behind?

I'm not using partial classes. But I did change one form to use partial
classes. After adding a new control, it still didn't add it in the declares
section but I could reference it in code (intellisense).

The only problem is that if you have a form with many controls, it's
difficult to remember the control name so now you are forced to look at the
properties in aspx where as if it was added to the declares, all you needed
to do is scan them and find the name by looking at the type - much quicker.
Mar 15 '07 #3
I think the converter did something wrong. If I were you, I'd just recreate
the forms manually (they will be partial classes) and copy-paste all code
from the converted ones (excluding the controls declaration in code-behind -
you don't need this in VS2005).
Mar 15 '07 #4
That would probably fix it, but unfortunately there are just too many files.
Maybe if I can extend the project.....

Thanks
Mar 15 '07 #5

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

Similar topics

4
by: WebBuilder451 | last post by:
Is there a good way to add master page functionality to an upgraded site. 1.1 vs32003 to 2.0 vs2005. So far i get some unusual errors when i try to apply to existing pages. and im getting some...
0
by: twistedinferno | last post by:
I have upgraded an application from asp.net 1.1 to asp.net 2 (VS 2005). The problem with this is I had a number of declared controls in base pages. In the base pages I use the events of the...
0
by: Kris G | last post by:
Hey. I have a weird problem. I upgraded our company webserver to host asp.net 2.0 pages. The server is also a domain controller, and was used for hosting asp.net 1.1 pages in the past....
3
by: Mark Denardo | last post by:
I'm trying to dynamically create and add controls to a web page: Label obj1 = new Label(); DropDownList obj2 = new DropDownList(); Controls.Add(obj1); Controls.Add(obj2); But I get the...
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
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.