Code Behind Problem

J

Joe

Hi,

When I start a new VS2005 website project, have a .aspx page
and I drop a control onto it and when I double-click on the event, it
brings up the .aspx.vb file so that I can add the VB event handler.

A designer sent me her project with .aspx pages and asked me
to connect it to a database. When I drop a control onto the .aspx
page and double-click on the event, it creates a VB event inside of
the .aspx file - instead of creating a separate .vb file.

Why is this? Is there some setting that I need to change to
get the separate .vb file?


J
 
D

Dave Bush

Make sure the page directive:

<%@ Page Language="VB" AutoEventWireup="false"
CodeFile="Default.aspx.vb" Inherits="_Default" %>

Has the CodeFile (what vb file is "behind" it) and Inherits keyword (the
name of the class in the vb file)

The one above is a copy and paste from a working project.

Dave Bush
http://blog.dmbcllc.com




-----Original Message-----
From: Joe [mailto:[email protected]]
Posted At: Wednesday, November 28, 2007 10:16 AM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: Code Behind Problem
Subject: Code Behind Problem

Hi,

When I start a new VS2005 website project, have a .aspx page
and I drop a control onto it and when I double-click on the event, it
brings up the .aspx.vb file so that I can add the VB event handler.

A designer sent me her project with .aspx pages and asked me
to connect it to a database. When I drop a control onto the .aspx
page and double-click on the event, it creates a VB event inside of
the .aspx file - instead of creating a separate .vb file.

Why is this? Is there some setting that I need to change to
get the separate .vb file?


J
 
C

Cowboy \(Gregory A. Beamer\)

She most likely set up the page without a code behind file. In addition to
what Dave has posted, make sure there is a .vb file with the page name.
 
D

Dave Bush

Right.. so obvious I forgot to mention it :)

-----Original Message-----
From: Cowboy (Gregory A. Beamer)
[mailto:[email protected]]
Posted At: Wednesday, November 28, 2007 11:07 AM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: Code Behind Problem
Subject: Re: Code Behind Problem

She most likely set up the page without a code behind file. In addition
to
what Dave has posted, make sure there is a .vb file with the page name.


..
 
C

Cowboy \(Gregory A. Beamer\)

NP.

I generally try to answer the ones that have not been answered, but
occasionally have a bit more time. The obvious, unfortunately, is often what
leads to follow up questions. :)


Dave Bush said:
Right.. so obvious I forgot to mention it :)

-----Original Message-----
From: Cowboy (Gregory A. Beamer)
[mailto:[email protected]]
Posted At: Wednesday, November 28, 2007 11:07 AM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: Code Behind Problem
Subject: Re: Code Behind Problem

She most likely set up the page without a code behind file. In addition
to
what Dave has posted, make sure there is a .vb file with the page name.


.
Hi,

When I start a new VS2005 website project, have a .aspx page
and I drop a control onto it and when I double-click on the event, it
brings up the .aspx.vb file so that I can add the VB event handler.

A designer sent me her project with .aspx pages and asked me
to connect it to a database. When I drop a control onto the .aspx
page and double-click on the event, it creates a VB event inside of
the .aspx file - instead of creating a separate .vb file.

Why is this? Is there some setting that I need to change to
get the separate .vb file?


J
 
D

Dave Bush

Yep

-----Original Message-----
From: Cowboy (Gregory A. Beamer)
[mailto:[email protected]]
Posted At: Wednesday, November 28, 2007 11:22 AM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: Code Behind Problem
Subject: Re: Code Behind Problem

NP.

I generally try to answer the ones that have not been answered, but
occasionally have a bit more time. The obvious, unfortunately, is often
what
leads to follow up questions. :)


Dave Bush said:
Right.. so obvious I forgot to mention it :)

-----Original Message-----
From: Cowboy (Gregory A. Beamer)
[mailto:[email protected]]
Posted At: Wednesday, November 28, 2007 11:07 AM
Posted To: microsoft.public.dotnet.framework.aspnet
Conversation: Code Behind Problem
Subject: Re: Code Behind Problem

She most likely set up the page without a code behind file. In addition
to
what Dave has posted, make sure there is a .vb file with the page name.


news:938744fa-ceb5-440b-a057-8100055c0a41@a35g2000prf.googlegroups.com..
.
Hi,

When I start a new VS2005 website project, have a .aspx page
and I drop a control onto it and when I double-click on the event, it
brings up the .aspx.vb file so that I can add the VB event handler.

A designer sent me her project with .aspx pages and asked me
to connect it to a database. When I drop a control onto the .aspx
page and double-click on the event, it creates a VB event inside of
the .aspx file - instead of creating a separate .vb file.

Why is this? Is there some setting that I need to change to
get the separate .vb file?


J
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,226
Members
46,815
Latest member
treekmostly22

Latest Threads

Top