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

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.security.membership
Imports system.web.security.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 5629
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.comwrote in message
news:11*********************@g4g2000hsf.googlegrou ps.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.security.membership
Imports system.web.security.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.comwrote:
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.security.membership
Imports system.web.security.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.page

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
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:...
4
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...
3
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...
54
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...
0
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...
18
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...
5
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: ...
3
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...
5
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
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...

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.