473,812 Members | 2,859 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

adding a vb codefile in visual studio 2005 - context is not a member of xxx

stupid question which I once think I had the answer to I'm sure.

I create webform page with no codebehind.

I then decide I want to create a codebehind for it.

How can I do it so that it falls under the aspx page and does give met
hat context error>

I tried creating the .vb file, and making sure the directive on the
aspx page points to it, but vs.net does not neatly place it under the
aspx page. I tried refreshing , ect..

Imports system.web.secu rity.membership
Imports system.web.secu rity.Roles
when i do a view code it does open the new codefile, but the
directive line on the aspx reads 'context is not a member of xxx.'

I noticed, i have the same problem if i move the vb codefile out and
then back into a directory in vs.net 2005.

Thanks for any help or information.

Jun 24 '07 #1
2 5655
There are no tools to convert inline code to code-behind.

Backup your file to another directory; delete the original file;
create a new file with the same name as your original file and make sure
you select the "Place code in separate file" option in the VS 2005 IDE.

Then, re-create your objects in the web form file.
The VS 2005 IDE will create the necessary code-behind.

When you're done, add your custom code to the code-behind file.
Sorry, I wish I had better news for you.

Juan T. Llibre, asp.net MVP
asp.net faq : http://asp.net.do/faq/
foros de asp.net, en español : http://asp.net.do/foros/
=============== =============== ========

"jobs" <jo**@webdos.co mwrote in message
news:11******** *************@g 4g2000hsf.googl egroups.com...
stupid question which I once think I had the answer to I'm sure.

I create webform page with no codebehind.

I then decide I want to create a codebehind for it.

How can I do it so that it falls under the aspx page and does give met
hat context error>

I tried creating the .vb file, and making sure the directive on the
aspx page points to it, but vs.net does not neatly place it under the
aspx page. I tried refreshing , ect..

Imports system.web.secu rity.membership
Imports system.web.secu rity.Roles
when i do a view code it does open the new codefile, but the
directive line on the aspx reads 'context is not a member of xxx.'

I noticed, i have the same problem if i move the vb codefile out and
then back into a directory in vs.net 2005.

Thanks for any help or information.


Jun 24 '07 #2
On Jun 24, 9:35 pm, jobs <j...@webdos.co mwrote:
stupid question which I once think I had the answer to I'm sure.

I create webform page with no codebehind.

I then decide I want to create a codebehind for it.

How can I do it so that it falls under the aspx page and does give met
hat context error>

I tried creating the .vb file, and making sure the directive on the
aspx page points to it, but vs.net does not neatly place it under the
aspx page. I tried refreshing , ect..

Imports system.web.secu rity.membership
Imports system.web.secu rity.Roles

when i do a view code it does open the new codefile, but the
directive line on the aspx reads 'context is not a member of xxx.'

I noticed, i have the same problem if i move the vb codefile out and
then back into a directory in vs.net 2005.

Thanks for any help or information.
hi...

I know its funny problem...
But it happens some time...
well you got to create a file... with name
lets say for default.aspx.vb for default.aspx page...
then in @page directive add codefile as your class names path and
inharits as the class in side the vb file...
oh one more thing... the class must be inharited from
system.web.ui.p age

thats it you are good to go...

Thanks
Masudur
http://munnacs.110mb.com

Jun 24 '07 #3

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

Similar topics

30
2242
by: Cowboy \(Gregory A. Beamer\) | last post by:
There seems to be a lot of confusion on the versions of Visual Studio 2005. My latest blog entry covers the different versions: Main URL: http://spaces.msn.com/members/gregorybeamer/Blog/cns!1ptsyfBgfiUmsaQCul95SOyg!141.entry If the above URL wraps and you want a shorter URL for the entry: http://tinyurl.com/9yxbs --
4
1648
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 web site. Default.aspx file is like following.
3
2322
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 Asp.Net 1.1 / VB.NET. These web sites use Access Databases and NOT Microsoft SQL 2000. In the future I will need to make a few changes now and then to this web sites.
54
6500
by: m.roello | last post by:
In the book: "Working with Microsoft Visual Studio 2005" Craig Skibo wrote: "The power of Visual Studio 2005 lies in its ability to empower users to build, test, and debug powerful applications quickly and easly." I don't agree on what concernes ASP .NET Web Sites in VS2005. All what involves Namespaces in Web sites has been disappeared. I know you can still MANUALLY manage them, but not QUICKLY and EASLY. In a
0
3358
by: fiona | last post by:
Innovasys Ltd., a leader in help authoring and documentation tools, today announced the inclusion of a tailored version of the Innovasys HelpStudio help authoring product, HelpStudio Lite, in the Microsoft Visual Studio 2005 Software Development Kit. By providing a full help authoring environment within the Visual Studio 2005 SDK, Innovasys is providing developers building components and products that integrate with Visual Studio 2005 a...
18
9159
by: surfrat_ | last post by:
Hi, I am having the following problems in getting Microsoft Visual Studio 2005 Professional to link to an Access .mdb database. Please help me to sort this out. Problem 1: The Microsoft page "How to: Connect to Data in an Access Database"
5
2023
by: vb newbie | last post by:
I found some sample VB code which I'm trying to implement in Visual Studio 2005. I think the code was VB6. VS05 doesn't like the syntax. I've distilled things down to the part with the error: Public Sub WontRun(ByVal v As ListView) Dim x As ListItem x = v.ListItems.Add(, , "c:\test\file.txt") End Sub
3
6070
by: Edwin Smith | last post by:
I have a 2 form project in VS2005 that now hangs whenever I try to do anything with the second form. This seems to have started when I added some SQL tables from a Pervasive v.9 database using the Pervasive ODBC driver. The devenv.exe process hangs and will not respond with about 50% cpu usage and about 100 megs of memory used. I am running it on an Athlon 64 bit dual core with 32 bit Windows XP pro. I have 2 megs of memory so I don't...
5
2528
by: Bob | last post by:
Hi, I have some very simple code that I have been using for quite a while that uses a streamwriter to write to a network file. I have never had any problems with it. I recently updated Visual Studio 2005 with Service Pack 1 and now it gives me the "Directory not found " exception when I try to write to a network location. I am running it on Vista as a standard user. However, I have opened Visual Studio using the "run as...
0
9734
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
10401
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...
1
10416
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 most users, this new feature is actually very convenient. If you want to control the update process,...
1
7676
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
6897
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
5567
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 the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5704
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4357
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
3029
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.