473,569 Members | 2,669 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Removing the " Web Form Designer Generated Code " region after converting from ASP.NET 1.1 to ASP.NET 2.0

I recently converted some ASP.NET 1.1 projects of mine, created with Visual
Studio .NET 2003, to Web Application Projects in Visual Studio .NET 2005 so
that I could use ASP.NET 2.0 (All my ASP.NET is done using VB.NET). After
converting, everything was fine, and worked and compiled correctly, but I
noticed one big difference between the VB.NET code of the converted files in
the projects and the VB.NET code in new pages. The new pages use partial
classes and do not have the " Web Form Designer Generated Code " region
where the controls were declared. When I try to modify the code in the
converted files to be like this, I recieve the following error:

Name 'mycontrolid' is not declared.

I am sure this is simply because I am not doing something or I am doing
something wrong, but I cannot figure out what. Any ideas? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Jul 5 '06 #1
6 6001
The separation of markup and code changed from "code-behind" in VS 2003
to "code-beside" in VS 2005. The @Page directive contains different
properties in the new model.

Nathan Sokalski wrote:
I recently converted some ASP.NET 1.1 projects of mine, created with Visual
Studio .NET 2003, to Web Application Projects in Visual Studio .NET 2005 so
that I could use ASP.NET 2.0 (All my ASP.NET is done using VB.NET). After
converting, everything was fine, and worked and compiled correctly, but I
noticed one big difference between the VB.NET code of the converted files in
the projects and the VB.NET code in new pages. The new pages use partial
classes and do not have the " Web Form Designer Generated Code " region
where the controls were declared. When I try to modify the code in the
converted files to be like this, I recieve the following error:

Name 'mycontrolid' is not declared.

I am sure this is simply because I am not doing something or I am doing
something wrong, but I cannot figure out what. Any ideas? Thanks.
Jul 5 '06 #2
That's great, but it still doesn't help me know what I should change my code
to. Here is my current @Page directive and Class definition from my
TextFiles.aspx and TextFiles.aspx. vb files:
<%@ Page Language="vb" AutoEventWireup ="false"
Codebehind="Tex tFiles.aspx.vb" Inherits="WebAp plication1.Text Files"
enableViewState ="False"%>

Public Class TextFiles
What changes do I need to make to this?
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Göran Andersson" <gu***@guffa.co mwrote in message
news:%2******** ********@TK2MSF TNGP04.phx.gbl. ..
The separation of markup and code changed from "code-behind" in VS 2003 to
"code-beside" in VS 2005. The @Page directive contains different
properties in the new model.

Nathan Sokalski wrote:
>I recently converted some ASP.NET 1.1 projects of mine, created with
Visual Studio .NET 2003, to Web Application Projects in Visual Studio
.NET 2005 so that I could use ASP.NET 2.0 (All my ASP.NET is done using
VB.NET). After converting, everything was fine, and worked and compiled
correctly, but I noticed one big difference between the VB.NET code of
the converted files in the projects and the VB.NET code in new pages. The
new pages use partial classes and do not have the " Web Form Designer
Generated Code " region where the controls were declared. When I try to
modify the code in the converted files to be like this, I recieve the
following error:

Name 'mycontrolid' is not declared.

I am sure this is simply because I am not doing something or I am doing
something wrong, but I cannot figure out what. Any ideas? Thanks.

Jul 5 '06 #3
As far as I can tell, you only have to change Codebehind to CodeFile.

Nathan Sokalski wrote:
That's great, but it still doesn't help me know what I should change my code
to. Here is my current @Page directive and Class definition from my
TextFiles.aspx and TextFiles.aspx. vb files:
<%@ Page Language="vb" AutoEventWireup ="false"
Codebehind="Tex tFiles.aspx.vb" Inherits="WebAp plication1.Text Files"
enableViewState ="False"%>

Public Class TextFiles
What changes do I need to make to this?
Jul 5 '06 #4
That makes sense, but here are several comments I have about that:

1. When I create a new WebForm it still uses Codebehind. I don't know if
this has something to do with the fact that I am using the Visual Studio
..NET 2005 Web Application Project model instead of the Visual Studio .NET
2005 Website model.

2. If I do change Codebehind to CodeFile I recieve an error saying
'TextFiles' is ambiguous in the namespace 'WebApplication 1'.

3. I tried creating one of my simple WebForms from scratch (deleting the
*.aspx and *.aspx.vb files and recreating it using the same controls and vb
code). It compiled and worked with no errors, but when I modify all the
lines of code in other WebForms to look the same (the @Page directive and
!DOCTYPE tag in the *.aspx file and add the Partial keyword to the class
definition in the *.aspx.vb file), it does not work. Is there some
configuration file that gets modified when you create a new WebForm by going
to Add->New Item?

I am not sure why, but simply modifying the *.aspx and *.aspx.vb files of a
WebForm won't let me get rid of the "Web Form Designer Generated Code "
region that used to get added by Visual Studio .NET 2003. If anyone has any
ideas, I would appreciate them.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Göran Andersson" <gu***@guffa.co mwrote in message
news:OU******** *****@TK2MSFTNG P03.phx.gbl...
As far as I can tell, you only have to change Codebehind to CodeFile.

Nathan Sokalski wrote:
>That's great, but it still doesn't help me know what I should change my
code to. Here is my current @Page directive and Class definition from my
TextFiles.as px and TextFiles.aspx. vb files:
<%@ Page Language="vb" AutoEventWireup ="false"
Codebehind="Te xtFiles.aspx.vb " Inherits="WebAp plication1.Text Files"
enableViewStat e="False"%>

Public Class TextFiles
What changes do I need to make to this?

Jul 6 '06 #5
Hi there,

I'm having the exact same problem.

Just wondering if you ever found a resolution or workaround in the end?

Cheers

"Nathan Sokalski" wrote:
That makes sense, but here are several comments I have about that:

1. When I create a new WebForm it still uses Codebehind. I don't know if
this has something to do with the fact that I am using the Visual Studio
..NET 2005 Web Application Project model instead of the Visual Studio .NET
2005 Website model.

2. If I do change Codebehind to CodeFile I recieve an error saying
'TextFiles' is ambiguous in the namespace 'WebApplication 1'.

3. I tried creating one of my simple WebForms from scratch (deleting the
*.aspx and *.aspx.vb files and recreating it using the same controls and vb
code). It compiled and worked with no errors, but when I modify all the
lines of code in other WebForms to look the same (the @Page directive and
!DOCTYPE tag in the *.aspx file and add the Partial keyword to the class
definition in the *.aspx.vb file), it does not work. Is there some
configuration file that gets modified when you create a new WebForm by going
to Add->New Item?

I am not sure why, but simply modifying the *.aspx and *.aspx.vb files of a
WebForm won't let me get rid of the "Web Form Designer Generated Code "
region that used to get added by Visual Studio .NET 2003. If anyone has any
ideas, I would appreciate them.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Göran Andersson" <gu***@guffa.co mwrote in message
news:OU******** *****@TK2MSFTNG P03.phx.gbl...
As far as I can tell, you only have to change Codebehind to CodeFile.

Nathan Sokalski wrote:
That's great, but it still doesn't help me know what I should change my
code to. Here is my current @Page directive and Class definition from my
TextFiles.aspx and TextFiles.aspx. vb files:
<%@ Page Language="vb" AutoEventWireup ="false"
Codebehind="Tex tFiles.aspx.vb" Inherits="WebAp plication1.Text Files"
enableViewState ="False"%>

Public Class TextFiles
What changes do I need to make to this?


Aug 28 '06 #6
What I discovered is that ASP.NET 2.0 organizes the code slightly
differently. The control declarations created by the designer are now put in
a file with the extension *.aspx.designer .vb or *.ascx.designer .vb. If you
want to copy and paste the declarations from ASP.NET 1.1 code into one of
these files, I would suggest that you create one file from scratch so that
you can see what the file looks like, the file layout is very basic. Good
Luck!
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Dune" <Du**@discussio ns.microsoft.co mwrote in message
news:CE******** *************** ***********@mic rosoft.com...
Hi there,

I'm having the exact same problem.

Just wondering if you ever found a resolution or workaround in the end?

Cheers

"Nathan Sokalski" wrote:
>That makes sense, but here are several comments I have about that:

1. When I create a new WebForm it still uses Codebehind. I don't know if
this has something to do with the fact that I am using the Visual Studio
..NET 2005 Web Application Project model instead of the Visual Studio
.NET
2005 Website model.

2. If I do change Codebehind to CodeFile I recieve an error saying
'TextFiles' is ambiguous in the namespace 'WebApplication 1'.

3. I tried creating one of my simple WebForms from scratch (deleting the
*.aspx and *.aspx.vb files and recreating it using the same controls and
vb
code). It compiled and worked with no errors, but when I modify all the
lines of code in other WebForms to look the same (the @Page directive and
!DOCTYPE tag in the *.aspx file and add the Partial keyword to the class
definition in the *.aspx.vb file), it does not work. Is there some
configuratio n file that gets modified when you create a new WebForm by
going
to Add->New Item?

I am not sure why, but simply modifying the *.aspx and *.aspx.vb files of
a
WebForm won't let me get rid of the "Web Form Designer Generated Code "
region that used to get added by Visual Studio .NET 2003. If anyone has
any
ideas, I would appreciate them.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/

"Göran Andersson" <gu***@guffa.co mwrote in message
news:OU******* ******@TK2MSFTN GP03.phx.gbl...
As far as I can tell, you only have to change Codebehind to CodeFile.

Nathan Sokalski wrote:
That's great, but it still doesn't help me know what I should change
my
code to. Here is my current @Page directive and Class definition from
my
TextFiles.as px and TextFiles.aspx. vb files:
<%@ Page Language="vb" AutoEventWireup ="false"
Codebehind="Te xtFiles.aspx.vb " Inherits="WebAp plication1.Text Files"
enableViewStat e="False"%>

Public Class TextFiles
What changes do I need to make to this?



Aug 29 '06 #7

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

Similar topics

2
12379
by: Bill N. | last post by:
Using VB .Net 2003 Standard Edition. This simple form has a "File in Use" problem while the executable is running. Created this simple program to make sure that I hadn't done something in my code in the "real" project. In the "real" project, One part of the program saves multiple images and another part of the program moves the images...
2
8295
by: Jaikumar | last post by:
Hi, 1) I have created one windows application, In the main form ( form1) i have added one usercontrol (usercontrol1), In that user control i am drawing one image. 2) In the UserControl1 i am showing one transparent form (form3) when ever user preseed left mouse button. 3) The form3 has one transparent user control (usercontrol2) that paints...
10
8187
by: Clint | last post by:
Hey all - I'm having a really confusing problem concerning a web service. Right now, I have an application that needs to call a web service that does nothing but return "true" (this will obviously change once the program's fully built to actually do something, but for testing, it works). The only code I added to the service is below:
1
2103
by: fl | last post by:
I am running ASPNET on my local machine. I have a problem when I try to connect to a SQL server database table. The data looks good when I right click SqlDataAdapter1 to preview the data. When F5 to run it, I get this error "Login failed for user '(null)'. Reason: Not associated with a trusted SQL Server connection..." Here is my code (they...
3
3180
by: Jon | last post by:
I'm learning about datatables. When using the example provided by MS in the ..NET Framework Class Library for DATATABLE (see below) I get an error on line 3 that says "Type expected". Is something missing from the code? Thanks - Jon Private Sub MakeParentTable() ' Create a new DataTable. Dim myDataTable As Datatable = New...
2
1919
by: eBob.com | last post by:
I've got the basics of an XML ini file working. I.E. I can stash away and retrieve user preferences. (Code below.) But how do I handle a new preference? Say I have A and B. And then I invent C. The first time the new version with C is run the XML file will not have a value for C. How do I detect that case? Somewhere I got the...
4
3137
by: Rod Gill | last post by:
Hi, I have a form that when opened in the designer appears of the screen. The form selector can't be dragged (or resized) and if I scroll right and down to centralise it the form simply jumps further away, completely leaving the selector box area. Any ideas? VS 2003 and VB.Net This is a simple application at the moment but the form is...
7
3374
by: Terry | last post by:
I have a Mainform with a Statusbar. When opening another form or doing some processing I want to display info in the Statusbar of the Mainform. I have read a lot of articles on this & have come up with the code below. It seems to work(!!!) in that when coding the second form I can see the DisplayStatusMsg of the main form. During debug the...
6
1894
by: Nathan Sokalski | last post by:
I recently converted some ASP.NET 1.1 projects of mine, created with Visual Studio .NET 2003, to Web Application Projects in Visual Studio .NET 2005 so that I could use ASP.NET 2.0 (All my ASP.NET is done using VB.NET). After converting, everything was fine, and worked and compiled correctly, but I noticed one big difference between the VB.NET...
0
7703
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7619
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language...
0
7931
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
0
8139
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that...
1
7682
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
3663
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3655
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
2119
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1230
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.