473,406 Members | 2,273 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,406 software developers and data experts.

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********@hotmail.com
http://www.nathansokalski.com/
Jul 5 '06 #1
6 1883
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="TextFiles.aspx.vb" Inherits="WebApplication1.TextFiles"
enableViewState="False"%>

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

"Göran Andersson" <gu***@guffa.comwrote in message
news:%2****************@TK2MSFTNGP04.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="TextFiles.aspx.vb" Inherits="WebApplication1.TextFiles"
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 'WebApplication1'.

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********@hotmail.com
http://www.nathansokalski.com/

"Göran Andersson" <gu***@guffa.comwrote in message
news:OU*************@TK2MSFTNGP03.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="TextFiles.aspx.vb" Inherits="WebApplication1.TextFiles"
enableViewState="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 'WebApplication1'.

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********@hotmail.com
http://www.nathansokalski.com/

"Göran Andersson" <gu***@guffa.comwrote in message
news:OU*************@TK2MSFTNGP03.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="TextFiles.aspx.vb" Inherits="WebApplication1.TextFiles"
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********@hotmail.com
http://www.nathansokalski.com/

"Dune" <Du**@discussions.microsoft.comwrote in message
news:CE**********************************@microsof t.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 'WebApplication1'.

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********@hotmail.com
http://www.nathansokalski.com/

"Göran Andersson" <gu***@guffa.comwrote in message
news:OU*************@TK2MSFTNGP03.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="TextFiles.aspx.vb" Inherits="WebApplication1.TextFiles"
enableViewState="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

0
by: Brian Morris | last post by:
I'm new to .NET and just trying a few things out, like emailing. I created a form in Visual Studio .Net to input some information for generating an email and I'm getting the following error when it...
2
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...
2
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...
10
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...
1
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...
3
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...
2
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...
4
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...
7
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...
6
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...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
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
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...
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...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.