ASP.NET中的部分类 [英] Partial class in ASP.NET

查看:77
本文介绍了ASP.NET中的部分类的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hajo,


我想要2个自己的部分课程。

例如:


Default.aspx.cs

Default2.aspx.cs


它们都与

Default.aspx页面有关。


我试图在很多方面做到这一点,但

我一直不走运。任何想法?


提前感谢任何信息


Gawel

Hajo,

I would like to have 2 my own partial classes.
For example:

Default.aspx.cs
Default2.aspx.cs

and they both will relate to
Default.aspx page.

I have tried to do this in many ways but
I''ve been unlucky. Any ideas?

thanks in advance for any info

Gawel

推荐答案

首先,部分类仅适用于ASP.NET 2.0。


如果您使用的是ASP.NET 2.0,请查看

部分类的通用文档:

http://msdn2.microsoft.com/library/m...us,vs.80).aspx


特定于C#部分类的文档位于:
http://msdn2.microsoft.com/library/w...us,vs.80).aspx


和,对于VB .NET,at:
http://msdn2.microsoft.com/library/y...us,vs.80).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 ...

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


< pa ********** @ gmail.com>在消息中写道

news:11 ********************** @ z14g2000cwz.googlegr oups.com ...
First of all, partial classes only work in ASP.NET 2.0.

If you''re using ASP.NET 2.0, check out
the generic documentation for partial classes :

http://msdn2.microsoft.com/library/m...us,vs.80).aspx

Documentation specific to C# partial classes is at :
http://msdn2.microsoft.com/library/w...us,vs.80).aspx

And, for VB.NET, at :
http://msdn2.microsoft.com/library/y...us,vs.80).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...
======================

<pa**********@gmail.com> wrote in message
news:11**********************@z14g2000cwz.googlegr oups.com...
Hajo,

我想有2个自己的部分课程。
例如:

Default.aspx.cs
Default2 .aspx.cs

它们都与
Default.aspx页面有关。

我试图在很多方面做到这一点但是
我运气不好。有任何想法吗?

提前感谢任何信息

Gawel
Hajo,

I would like to have 2 my own partial classes.
For example:

Default.aspx.cs
Default2.aspx.cs

and they both will relate to
Default.aspx page.

I have tried to do this in many ways but
I''ve been unlucky. Any ideas?

thanks in advance for any info

Gawel



Hajo,

我使用.NET框架的beta 2。

我可以通过Windows窗体应用程序获得所需的效果

但是我不能这样做使用ASP.NET应用程序。

VS.NET似乎没有看到额外的类让我们说'

Default2.aspx.cs。我理解部分类的概念

但是我无法在网络应用程序中使用它们。


有什么想法吗?


Gawel

Hajo,

I use beta 2 of .NET framework.
I can gain desired effect with Windows Forms Application
but I can not do the same with ASP.NET application.
VS.NET seems not to see the additional class let''s say
Default2.aspx.cs. I understand the concept of partial classes
but I am not able to use them in web application.

Any ideas?

Gawel


你必须编译应用程序才能让它按照你想要的方式工作。默认情况下,每个页面都会动态编译。如果你遵循默认的

模型,每页只能使用一个部分类。


-

Gregory A. Beamer

MVP; MCP:+ I,SE,SD,DBA


***************************

在盒子外面思考!

*************************** >
" pa ********** @ gmail.com"写道:
You will have to compile the application to get it to work the way you
desire. By default, each page compiles on the fly. If you follow the default
model, only one partial class can be used per page.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

***************************
Think Outside the Box!
***************************
"pa**********@gmail.com" wrote:
Hajo,

我想有2个我自己的部分课程。
例如:

Default.aspx.cs
Default2.aspx.cs

它们都与
Default.aspx页面有关。

我试过做这在很多方面,但是我很不走运。有任何想法吗?

提前感谢任何信息

Gawel
Hajo,

I would like to have 2 my own partial classes.
For example:

Default.aspx.cs
Default2.aspx.cs

and they both will relate to
Default.aspx page.

I have tried to do this in many ways but
I''ve been unlucky. Any ideas?

thanks in advance for any info

Gawel



这篇关于ASP.NET中的部分类的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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