473,796 Members | 2,621 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 1900
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

0
4615
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 executes both on my server or on the server of the .NET service provider. I'm obviously missing something very basic and I'm hoping one of you can point out my error. Thank you for your assistance. Brian
2
12407
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 to the appropriate directories based on user feedback.
2
8314
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 circles. That measn the circles will show on top the usercontrol1 image. 4) The form3 border style...
10
8210
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
2118
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 are all generated by the wizard): Public Class WebForm1 Inherits System.Web.UI.Page
3
3194
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 Datatable("ParentTable")
2
1931
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 impression that I could use IsNull, but I was unable to find an example which I could apply to my code. My...
4
3160
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 inherited from a
7
3390
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 code runs through & seemingly executes the call without error. But!...The message is not displayed....
6
6020
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 code of the converted files in the projects and the VB.NET code in new pages. The new pages use...
0
9685
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 usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10237
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 captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
10018
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9055
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7553
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6795
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5578
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4120
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
3
2928
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.