开发者

Asp + code behind: reference missing?

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 http://dl.dropbox.com/u/304开发者_如何转开发5472/ex.png

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.


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.


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.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜