无法掌握ASP 2.0中的Web UserControls [英] Cannot get a handle on web UserControls in ASP 2.0

查看:49
本文介绍了无法掌握ASP 2.0中的Web UserControls的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在将一些ASP Web项目从VS 2003转换为VS2005 / ASP 2.0。我遇到的最糟糕的问题是所有引用(在代码隐藏的CS文件中)

UserControls失败。


我得到错误类型或命名空间'MyUserControl''不存在于

命名空间''.Correct.Namespace''(你错过了程序集引用吗?)"

即使有问题的用户控件被命名为''MyUserControl''并且是明确地包装在命名空间块''命名空间中的
.The .Correct.NameSpace

{''。并且,显然,它在之前的框架中工作,所以它不是一个错字。


有没有办法克服这个转换问题?


谢谢。


Greg Smalter

I''m converting some ASP web projects from VS 2003 to VS2005/ASP 2.0. The
worst problem I''ve run into is all references (in codebehind CS files) to
UserControls fail.

I get the error "The type or namespace ''MyUserControl'' does not exist in the
namespace ''The.Correct.Namespace'' (are you missing an assembly reference?)"
even though the user control in question is named ''MyUserControl'' and is
explicitly wrapped in the namespace block ''namespace The.Correct.NameSpace
{''. And, obviously, it worked in the previous framework so it''s not a typo.

Is there an approach for overcoming this conversion issue?

Thank you.

Greg Smalter

推荐答案

页面指令中的措辞发生了变化beta 2.本文[1]

可能有所帮助。困扰我的是,似乎没有一个中心位置

,其中记录了变更。这当然是FUBAR。


我要发布到MSDN产品反馈[2]并要求一个集中的

页面或博客跟踪改变并要求你做同样的事情


<%=克林顿加拉格尔

METROmilwaukee(sm)地区信息服务

NET csgallagher AT metromilwaukee.com

URL http://metromilwaukee.com /

URL http://clintongallagher.metromilwaukee.com /

[1] http://west-wind.com/weblog/posts/2122.aspx

[2] http://lab.msdn.microsoft.com/Produc...k/Default.aspx


" Greg Smalter" <的Gr ********* @ discussions.microsoft.com>在留言中写道

news:84 ********************************** @ microsof t.com ...
The verbiage in the page directive has changed in beta 2. This article [1]
may help. What bothers me is there does not appear to be a central location
where changes have been documented. This of course is FUBAR.

I''m going to post to MSDN Product Feedback [2] and ask for a centralized
page or blog that tracks changes and ask you to do the same

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

[1] http://west-wind.com/weblog/posts/2122.aspx
[2] http://lab.msdn.microsoft.com/Produc...k/Default.aspx

"Greg Smalter" <Gr*********@discussions.microsoft.com> wrote in message
news:84**********************************@microsof t.com...
我正在将一些ASP Web项目从VS 2003转换为VS2005 / ASP 2.0。我遇到的最糟糕的问题是所有引用(在代码隐藏的CS文件中)到用户控件失败。

我收到错误类型或命名空间
命名空间''.Correct.Namespace''(你错过了一个程序集
引用吗?)
即使用户控件也没有MyUserControl''有问题被命名为''MyUserControl''并且明确地包含在命名空间块''名称空间The.Correct.NameSpace
{''中。并且,显然,它在之前的框架中工作,所以它不是一个错误。

有没有办法克服这个转换问题?

谢谢你。

Greg Smalter
I''m converting some ASP web projects from VS 2003 to VS2005/ASP 2.0. The
worst problem I''ve run into is all references (in codebehind CS files) to
UserControls fail.

I get the error "The type or namespace ''MyUserControl'' does not exist in
the
namespace ''The.Correct.Namespace'' (are you missing an assembly
reference?)"
even though the user control in question is named ''MyUserControl'' and is
explicitly wrapped in the namespace block ''namespace The.Correct.NameSpace
{''. And, obviously, it worked in the previous framework so it''s not a
typo.

Is there an approach for overcoming this conversion issue?

Thank you.

Greg Smalter



这解释了一些关于编译模型是如何不同的,但它是

没有提到命名空间或如何处理转换。好的信息

虽然,谢谢。


我仍​​然需要一种方法让我现有的ASP 1.1框架网站工作在

ASP 2.0通过解决此命名空间问题并获得控件处理

类。这似乎是可能的,因为如果我创建一个新的网站并在根目录中创建一个

控件,我可以从默认页面静态访问它。

但是如果我在文件夹中创建它,我不能。并且我无法找到它用于文件夹中的控件的命名空间

。我需要

才能静态访问控制类,无论它们在哪里,

就像我以前一样。


谢谢你好。


Greg Smalter


" clintonG"写道:
That explains a little about how the compilation models are different, but it
doesn''t mention namespaces or how to address a transition. Good information
though, thanks.

I still need a way to make my existing ASP 1.1 framework web sites work in
ASP 2.0 by resolving this namespace issue and getting a handle on control
classes. It seems possible, because if I create a new web site and create a
control loose in the root, I can access it statically from the default page.
But if I create it in a folder, I can''t. And there''s no way for me to find
out what namespace it''s using for the control in the folder, either. I need
to be able to statically access control classes no matter where they are,
like I used to.

Thank you.

Greg Smalter

"clintonG" wrote:
页面指令中的措辞在beta 2中发生了变化。本文[1]
可能有所帮助。困扰我的是,似乎没有一个中心位置
哪里有变更记录。这当然是FUBAR。

我要发布到MSDN产品反馈[2]并要求一个集中的页面或博客来跟踪变化并要求你做同样的事情

<%= Clinton Gallagher
METROmilwaukee(sm)区域信息服务
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

[1] http://west-wind.com/weblog/posts/2122.aspx
[2] http://lab.msdn.microsoft.com/Produc ... k / Default.aspx

Greg Smalter <的Gr ********* @ discussions.microsoft.com>在消息中写道
新闻:84 ********************************** @ microsof t.com。 ..
The verbiage in the page directive has changed in beta 2. This article [1]
may help. What bothers me is there does not appear to be a central location
where changes have been documented. This of course is FUBAR.

I''m going to post to MSDN Product Feedback [2] and ask for a centralized
page or blog that tracks changes and ask you to do the same

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

[1] http://west-wind.com/weblog/posts/2122.aspx
[2] http://lab.msdn.microsoft.com/Produc...k/Default.aspx

"Greg Smalter" <Gr*********@discussions.microsoft.com> wrote in message
news:84**********************************@microsof t.com...
我正在将一些ASP Web项目从VS 2003转换为VS2005 / ASP 2.0。我遇到的最糟糕的问题是所有引用(在代码隐藏的CS文件中)到用户控件失败。

我收到错误类型或命名空间
命名空间''.Correct.Namespace''(你错过了一个程序集
引用吗?)
即使用户控件也没有MyUserControl''有问题被命名为''MyUserControl''并且明确地包含在命名空间块''名称空间The.Correct.NameSpace
{''中。并且,显然,它在之前的框架中工作,所以它不是一个错误。

有没有办法克服这个转换问题?

谢谢你。

Greg Smalter
I''m converting some ASP web projects from VS 2003 to VS2005/ASP 2.0. The
worst problem I''ve run into is all references (in codebehind CS files) to
UserControls fail.

I get the error "The type or namespace ''MyUserControl'' does not exist in
the
namespace ''The.Correct.Namespace'' (are you missing an assembly
reference?)"
even though the user control in question is named ''MyUserControl'' and is
explicitly wrapped in the namespace block ''namespace The.Correct.NameSpace
{''. And, obviously, it worked in the previous framework so it''s not a
typo.

Is there an approach for overcoming this conversion issue?

Thank you.

Greg Smalter




克林顿,


我认为您要求的内容已于2004年11月在MSDN上发布了



http://msdn.microsoft.com/asp.net/wh...ta2update.aspx


ASP.NET Beta 2信息的集中页面位于:

http://msdn.microsoft.com/asp.net/beta2/default.aspx


给它添加书签。


我至少每周一次去那里,以适应变化/功能。


Juan T. Llibre

ASP.NET MVP
http://asp.net.do/foros/

Foros de ASP。 NET en Espa?ol

Ven,y hablemos de ASP.NET ...

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


" clintonG" < CS ********* @ REMOVETHISTEXTmetromilwaukee.com>写在消息

新闻:%2 **************** @ TK2MSFTNGP12.phx.gbl ...
Clinton,

I think that what you''re requesting was published
at MSDN in November 2004 :

http://msdn.microsoft.com/asp.net/wh...ta2update.aspx

The centralized page for ASP.NET Beta 2 information is at :

http://msdn.microsoft.com/asp.net/beta2/default.aspx

Bookmark it.

I go there at least weekly to get up to speed with changes/features.

Juan T. Llibre
ASP.NET MVP
http://asp.net.do/foros/
Foros de ASP.NET en Espa?ol
Ven, y hablemos de ASP.NET...
======================

"clintonG" <cs*********@REMOVETHISTEXTmetromilwaukee.com> wrote in message
news:%2****************@TK2MSFTNGP12.phx.gbl...
措辞在页面指令中已经在beta 2中发生了变化。本文[1]可能有所帮助。
困扰我的是,似乎没有一个中心位置,其中记录了更改。这当然是FUBAR。

我要发布到MSDN产品反馈[2]并要求一个集中的页面或博客来跟踪变化并要求你做同样的事情

<%= Clinton Gallagher
METROmilwaukee(sm)区域信息服务
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

[1] http://west-wind.com/weblog/posts/2122.aspx
[2] http://lab.msdn.microsoft.com/Produc ... k / Default.aspx

Greg Smalter <的Gr ********* @ discussions.microsoft.com>在消息中写道
新闻:84 ********************************** @ microsof t.com。 ..
The verbiage in the page directive has changed in beta 2. This article [1] may help.
What bothers me is there does not appear to be a central location where changes have
been documented. This of course is FUBAR.

I''m going to post to MSDN Product Feedback [2] and ask for a centralized page or blog
that tracks changes and ask you to do the same

<%= Clinton Gallagher
METROmilwaukee (sm) "A Regional Information Service"
NET csgallagher AT metromilwaukee.com
URL http://metromilwaukee.com/
URL http://clintongallagher.metromilwaukee.com/

[1] http://west-wind.com/weblog/posts/2122.aspx
[2] http://lab.msdn.microsoft.com/Produc...k/Default.aspx

"Greg Smalter" <Gr*********@discussions.microsoft.com> wrote in message
news:84**********************************@microsof t.com...
我正在将一些ASP Web项目从VS 2003转换为VS2005 / ASP 2.0。我遇到的最糟糕的问题是所有引用(在代码隐藏的CS文件中)到用户控件失败。

我收到错误类型或命名空间 MyUserControl''不存在于
命名空间''.Correct.Namespace''(你错过了程序集引用吗?)
即使有问题的用户控件被命名为''MyUserControl' '并且明确地包含在命名空间块''命名空间The.Correct.NameSpace
{''。并且,显然,它在之前的框架中工作,所以它不是一个错字。

有没有办法克服这个转换问题?

谢谢。

Greg Smalter
I''m converting some ASP web projects from VS 2003 to VS2005/ASP 2.0. The
worst problem I''ve run into is all references (in codebehind CS files) to
UserControls fail.

I get the error "The type or namespace ''MyUserControl'' does not exist in the
namespace ''The.Correct.Namespace'' (are you missing an assembly reference?)"
even though the user control in question is named ''MyUserControl'' and is
explicitly wrapped in the namespace block ''namespace The.Correct.NameSpace
{''. And, obviously, it worked in the previous framework so it''s not a typo.

Is there an approach for overcoming this conversion issue?

Thank you.

Greg Smalter




这篇关于无法掌握ASP 2.0中的Web UserControls的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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