如何告诉VS2005代码隐藏文件? [英] How do I tell VS2005 about a code-behind file?

查看:81
本文介绍了如何告诉VS2005代码隐藏文件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好,


到目前为止,我一直在使用文本编辑器开发ASP.NET(更好的方式来开始学习
),现在已经尝试Visual Web Developer。我想

为现有网站创建项目并将文件添加到其中。我可以

添加我的.aspx和.cs(代码隐藏)文件,但是VWD不知道哪个.cs

文件是任何代码隐藏特别是.aspx文件。


当你在VWD中创建一个新的aspx页面时,它会自动将

代码隐藏文件与aspx放在一起。我可以为现有的

文件做这个吗?


TIA


-

Alan Silver

(此行下面添加的任何内容都与我无关)

Hello,

I have been developing ASP.NET with a text editor so far (better way to
learn initially), and have now been trying Visual Web Developer. I want
to create a project for an existing site and add the files to it. I can
add my .aspx and .cs (code-behind) files, but VWD doesn''t know which .cs
file si the code-behind for any particular .aspx file.

When you create a new aspx page in VWD, it automatically puts the
code-behind file with the aspx. Can I make it do this for my existing
files?

TIA

--
Alan Silver
(anything added below this line is nothing to do with me)

推荐答案

:add我的.aspx和.cs(代码隐藏)文件,但是VWD不知道哪个.cs

:文件是任何特定.aspx文件的代码隐藏。


添加属性CodeBehind =< file> .cs到@ Page关于

顶部的指令。

-

干杯,

Gaurav Vaish
http://mastergaurav.org

---------- -------------------
: add my .aspx and .cs (code-behind) files, but VWD doesn''t know which .cs
: file si the code-behind for any particular .aspx file.

Add an attribute "CodeBehind=<file>.cs" to the "@ Page" Directive on the
top.
--
Cheers,
Gaurav Vaish
http://mastergaurav.org
-----------------------------


>:添加我的.aspx和.cs(代码隐藏)文件,但是VWD不知道哪个.cs
>: add my .aspx and .cs (code-behind) files, but VWD doesn''t know which .cs
:为任何特定的.aspx文件提供代码隐藏文件。

添加属性CodeBehind =<文件>&的.cs QUOT;到@ Page关于
的指令。
: file si the code-behind for any particular .aspx file.

Add an attribute "CodeBehind=<file>.cs" to the "@ Page" Directive on the
top.




VWD在CodeBehind投诉,称不再支持。我尝试使用CodeFile来代替
,因为VWD生成使用它,然后它确认.cs文件是.aspx的代码隐藏的.cs文件,但是

没有改变解决方案资源管理器中的显示。他们仍然显示为单独的项目。


还有其他想法吗?谢谢。


-

Alan Silver

(此行下面添加的任何东西都与我无关)



VWD complained at CodeBehind, saying it was no longer supported. I tried
using CodeFile instead as the ones VWD generates use that, and then it
recognised the .cs file as being the code-behind for the .aspx, but
didn''t change the display in the solution explorer. They were still
shown as separate items.

Any other ideas? Thanks.

--
Alan Silver
(anything added below this line is nothing to do with me)


re:
它将.cs文件识别为.aspx的代码隐藏,但没有改变
显示在解决方案资源管理器中。它们仍然显示为单独的项目。
it recognised the .cs file as being the code-behind for the .aspx, but didn''t change the
display in the solution explorer. They were still shown as separate items.




我不明白。它们将*始终*显示为单独的项目。


您可以单独编辑* .aspx和* .aspx.cs文件。

我错过了什么?


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/

======================================

Alan Silver <人********* @ nospam.thanx>在消息中写道

news:mw ************** @ nospamthankyou.spam ...



I don''t understand. They will *always* be shown as separate items.

You can edit *.aspx and *.aspx.cs files separately.
Am I missing something ?


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/
======================================
"Alan Silver" <al*********@nospam.thanx> wrote in message
news:mw**************@nospamthankyou.spam...

:添加我的.aspx和.cs(代码隐藏)文件,但是VWD不知道哪个.cs
:文件是任何特定.aspx文件的代码隐藏。
顶部的指令。
: add my .aspx and .cs (code-behind) files, but VWD doesn''t know which .cs
: file si the code-behind for any particular .aspx file.

Add an attribute "CodeBehind=<file>.cs" to the "@ Page" Directive on the
top.



VWD在CodeBehind投诉,称它不再受支持。我尝试使用CodeFile
而不是VWD生成使用它,然后它将.cs文件识别为.aspx的代码隐藏,但是没有改变显示在解决方案资源管理器。
它们仍被显示为单独的项目。

任何其他想法?谢谢。

-
Alan Silver
(此行下面添加的任何内容都与我无关)



VWD complained at CodeBehind, saying it was no longer supported. I tried using CodeFile
instead as the ones VWD generates use that, and then it recognised the .cs file as being
the code-behind for the .aspx, but didn''t change the display in the solution explorer.
They were still shown as separate items.

Any other ideas? Thanks.

--
Alan Silver
(anything added below this line is nothing to do with me)


这篇关于如何告诉VS2005代码隐藏文件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆