views:

38

answers:

2

I'm currently working on a project I've just received that is asp.net + vb. I have to add a gridview in one part of the page, but it simply won't let me set the datasource

<%@ Page Language="VB" MasterPageFile="~/Common/Common.master" title=whatever" %>
<%@ Register TagPrefix="uct" TagName="SubmenuControl" Src="whatever.ascx" %>

this loads the masterpage and a simple menu.

I had to create a page, so I've based myself on the existing ones:

somepage.asp

Based on othes pages, I've copied the code behind insertion method:

<%@ Import Namespace="somelibrary" %>
<%@ Import Namespace="otherlibrary" %>

<script runat="server">
'some vb code
</script>

But when I compile, I get the message:

alt text

Did I forget something? I use simple system references (IO and DATA) it should work without any adition, I've added anyway the .data reference, but it doesn't work, so, what should I do ?

Since there's no vb coding in this question, you could answer it in C# or VB if any addition is needed in the code behind.

info:
0-Visual Studio 2008
1-Works without this page
2-VB.NET but you can use C#
3-I'm new to asp, don't freak out
4-Without the references, the objects that use those references aren't recognized (underlined as reference missing) so the references load OK in theory.
5-If instead of adding the reference in the beginning I give the complete path to the object (ex.: system.io.fileinfo) I get the exact same error.
6-I'm watching this question, anything else you need to know, comment.

+1  A: 

You aren't compiling, you're running in debug mode. The startup project you have set is not the ASP.NET project. In Solution Explorer, right click on the web project itself, and select "Set as startup project". Or to simply compile, try Ctrl-Shift-B.

David M
I was setting the default page as startup, i should have set the whole page, thank you and sorry!
MarceloRamires
A: 

Visual Studio often "runs" whichever project you have open in the text editor (depending on how you invoke the run/build command).

Try opening the default.aspx page in the text editor before you run/debug the project.

Stephen M. Redd
That is odd. The error doesn't match the cause. Perhaps it is something specific to VB projects, but nothing in the code you show above should be able to cause that kind of error. Perhaps there is something else about your project's config, but I have insufficient info to figure out what.
Stephen M. Redd