动态显示/隐藏TR的组 [英] Dynamically Show/Hide Groups of TR's

查看:51
本文介绍了动态显示/隐藏TR的组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我搜索了一段时间试图找到答案,但无济于事。


我正试图找到动态显示的最佳方式(或任何方式)隐藏

组的TR'。例如,我有一个约6个表行的部分,如果满足某个条件,则需要隐藏
。但我不想

隐藏整张桌子。并且,我不想拆分桌子,因为

列需要保持不变。


我想在每个上使用runat = server TR的,只是隐藏它们每个单独的
,但这看起来真的很邋and,我认为那里

必须是一个更好的方法来做到这一点。我真的需要一些不含HTML的

容器,它可以作为TR'的包装器,而不会渲染任何额外的HTML。


asp:PlaceHolder是完美的,因为它不会渲染任何额外的

HTML,但它在设计时不允许任何其他嵌套服务器控件

(看起来很傻)。而asp:Panel可以包装任何HTML或服务器

控件,但它呈现HTML(IE中的div和Netscape中的表 -

真的输入了HTML) 。并且< span runat = server>不喜欢嵌套的TR'。


我只需要一些包装器服务器控件,可以包含任何内容(HTML

和服务器控件),而无需在任何浏览器上呈现任何HTML。好像

这将被广泛使用(和需要)功能,但我没有太多的运气

找到这样的东西。

如有任何建议,我们将不胜感激。


提前感谢您的帮助!

Jerad

解决方案

我使用PlaceHolder< tr>元素一直在。如果你使用的是asp表对象,这可能不会是
工作,但是如果你使用的话,那就不要....它是......这是不必要的开销。此外,也许它在设计视图中给你一个错误,

但是如果它......不使用设计视图,请使用HTML视图。


~PJ


" Jerad Rose" < JE **** @ corvusdigital.com>在消息中写道

新闻:uq ************** @ tk2msftngp13.phx.gbl ...

我搜了一会儿试图找到答案,但无济于事。

我正试图找到动态显示和隐藏TR组的最佳方式(或任何方式)。例如,我有一个大约6个表行的部分,如果满足某个条件,则需要隐藏它们。但我不想隐藏整张桌子。并且,我不想拆分桌子,因为
列需要保持完整。

我想在每个TR上使用runat = server,并且只是每个人都隐藏了
,但这看起来真的很草率,而且我认为
必须是一个更好的方法。我真的需要某种无HTML的容器,它可以作为TR'的包装器,而不会呈现任何额外的HTML。

一个asp:PlaceHolder会是完美,因为它不会渲染任何额外的HTML,但它在设计时不允许任何其他嵌套服务器控件
(这看起来很愚蠢)。而asp:Panel可以包装任何HTML或服务器
控件,但它呈现HTML(IE浏览器中的div和Netscape中的表格 -
真的输入了HTML)。并且< span runat = server>不喜欢嵌套的
TR'。
我只需要一些包装。服务器控件,可以包含任何内容(HTML
和服务器控件),而无需在任何浏览器上呈现任何HTML。似乎
这样会广泛使用(和需要)功能,但我没有多少
运气找到这样的东西。

任何建议都将不胜感激。

提前感谢您的帮助!
Jerad






为什么你认为使TR runat =服务器变得草率?

runat = server是ASP.NET的基础之一。


Natty Gur,首席技术官

Dao2Com Ltd.

28th Baruch Hirsch st。 Bnei-Brak

以色列,51114

电话号码:

办公室:+ 972-(0)3-5786668

传真:+ 972-(0)3-5703475

手机:+ 972-(0)58-888377


了解整体情况

***通过开发人员指南 http://www.developersdex发送。 com ***

不要只参加USENET ......获得奖励!


>我使用PlaceHolder< tr>元素一直都是。


这不是< tr> PlaceHolder遇到问题的元素 -

它是我的< tr>内的服务器控件。

PlaceHolder不支持的元素。就像我说的那样,我需要一些允许

嵌入式HTML和服务器控件的东西。


感谢您的回复,但它看起来不像PlaceHolder将在这种情况下使用



" PJ" < PJ *** @ hotmail.com>在消息中写道

新闻:uJ **************** @ tk2msftngp13.phx.gbl ...

我用的是PlaceHolder< tr>元素一直在。如果你使用的是asp表对象,这可能不会起作用,但是如果你使用的话,那就不要......它是不必要的开销。另外,也许它在设计视图中给你一个错误,
但是如果它......不使用设计视图,请使用HTML视图。

~PJ

Jerad Rose < JE **** @ corvusdigital.com>在消息中写道
新闻:uq ************** @ tk2msftngp13.phx.gbl ...

我搜索了一会儿试图找到回答这个,但没有
可用。
我试图找到动态显示的最佳方式(或任何方式)和
隐藏TR的组。例如,我有一个大约6个表行
的部分,如果满足某个条件,则需要隐藏它们。但我不想要
来隐藏整个桌子。并且,我不想拆分桌子,因为
列需要保持完整。

我想在每个TR上使用runat = server,并且只是隐藏


他们

每个人,但这看起来真的很草率,我认为
必须有更好的方法来做到这一点。我真的需要某种无HTML的容器,它可以作为TR'的包装器,而不会呈现任何额外的HTML。

一个asp:PlaceHolder会是完美,因为它不会渲染任何
额外的HTML,但它不允许任何其他嵌套服务器控件设计
时间(这看起来很愚蠢)。并且asp:Panel可以包装任何HTML或
服务器控件,但它呈现HTML(IE中的div和Netscape中的表 - 它实际上隐藏了HTML)。并且< span runat = server>不喜欢嵌套


TR'。


我只需要一些包装器。服务器控件,可以包含任何
(HTML和服务器控件),而无需在任何浏览器上呈现任何HTML。似乎


这将被广泛使用(和需要)功能,但我没有太多


运气

找到这样的东西。

任何建议都将不胜感激。

提前感谢您的帮助!
Jerad



I searched for a while trying to find the answer to this, but to no avail.

I am trying to find the best way (or any way) to dynamically show and hide
groups of TR''s. For example, I have a section of about 6 table rows that
all need to be hidden if a certain condition is met. But I don''t want to
hide the whole table. And, I don''t want to split up the table because the
columns need to remain intact.

I thought about using runat=server on each of the TR''s, and just hiding them
each individually, but that just seems really sloppy, and I thought there
had to be a better way to do it. I really need some sort of HTML-less
container that can serve as a wrapper for the TR''s without rendering any
additional HTML.

An asp:PlaceHolder would be perfect since it doesn''t render any additional
HTML, but it doesn''t allow any other nested server controls at design time
(which seems silly). And an asp:Panel can wrap around any HTML or server
controls, but it renders HTML (div in IE and table in Netscape -- which
really hoses the HTML). And a <span runat=server> doesn''t like nested TR''s.

I just need some "wrapper" server control that can contain anything (HTML
and Server controls) without rendering ANY HTML on any browser. Seems like
this would be widely used (and needed) feature, but I haven''t had much luck
finding such a thing.

Any suggestions would be appreciated.

Thanks in advance for your help!
Jerad

解决方案

I use the PlaceHolder around <tr> elements all the time. This might not
work if you are using an asp table object, but if you are, don''t....it''s
uncessary overhead. Also, maybe it''s giving you an error in design view,
but if it is...don''t use design view, use HTML view.

~PJ

"Jerad Rose" <je****@corvusdigital.com> wrote in message
news:uq**************@tk2msftngp13.phx.gbl...

I searched for a while trying to find the answer to this, but to no avail.

I am trying to find the best way (or any way) to dynamically show and hide
groups of TR''s. For example, I have a section of about 6 table rows that
all need to be hidden if a certain condition is met. But I don''t want to
hide the whole table. And, I don''t want to split up the table because the
columns need to remain intact.

I thought about using runat=server on each of the TR''s, and just hiding them each individually, but that just seems really sloppy, and I thought there
had to be a better way to do it. I really need some sort of HTML-less
container that can serve as a wrapper for the TR''s without rendering any
additional HTML.

An asp:PlaceHolder would be perfect since it doesn''t render any additional
HTML, but it doesn''t allow any other nested server controls at design time
(which seems silly). And an asp:Panel can wrap around any HTML or server
controls, but it renders HTML (div in IE and table in Netscape -- which
really hoses the HTML). And a <span runat=server> doesn''t like nested TR''s.
I just need some "wrapper" server control that can contain anything (HTML
and Server controls) without rendering ANY HTML on any browser. Seems like this would be widely used (and needed) feature, but I haven''t had much luck finding such a thing.

Any suggestions would be appreciated.

Thanks in advance for your help!
Jerad



Hi,

Why do you think that make the TR runat=server is sloppy ?
runat=server is one of the bases of ASP.NET.

Natty Gur, CTO
Dao2Com Ltd.
28th Baruch Hirsch st. Bnei-Brak
Israel , 51114

Phone Numbers:
Office: +972-(0)3-5786668
Fax: +972-(0)3-5703475
Mobile: +972-(0)58-888377

Know the overall picture
*** Sent via Developersdex http://www.developersdex.com ***
Don''t just participate in USENET...get rewarded for it!


> I use the PlaceHolder around <tr> elements all the time.

It''s not the <tr> elements that the PlaceHolder is having problems with --
it''s the server controls that are within my <tr> elements that the
PlaceHolder doesn''t support. Like I said, I need something that will allow
both embedded HTML _and_ server controls.

Thanks for your reply, but it doesn''t seem like a PlaceHolder is going to
work with this situation.

"PJ" <pj***@hotmail.com> wrote in message
news:uJ****************@tk2msftngp13.phx.gbl...

I use the PlaceHolder around <tr> elements all the time. This might not
work if you are using an asp table object, but if you are, don''t....it''s
uncessary overhead. Also, maybe it''s giving you an error in design view,
but if it is...don''t use design view, use HTML view.

~PJ

"Jerad Rose" <je****@corvusdigital.com> wrote in message
news:uq**************@tk2msftngp13.phx.gbl...

I searched for a while trying to find the answer to this, but to no avail.
I am trying to find the best way (or any way) to dynamically show and hide groups of TR''s. For example, I have a section of about 6 table rows that all need to be hidden if a certain condition is met. But I don''t want to hide the whole table. And, I don''t want to split up the table because the columns need to remain intact.

I thought about using runat=server on each of the TR''s, and just hiding


them

each individually, but that just seems really sloppy, and I thought there had to be a better way to do it. I really need some sort of HTML-less
container that can serve as a wrapper for the TR''s without rendering any
additional HTML.

An asp:PlaceHolder would be perfect since it doesn''t render any additional HTML, but it doesn''t allow any other nested server controls at design time (which seems silly). And an asp:Panel can wrap around any HTML or server controls, but it renders HTML (div in IE and table in Netscape -- which
really hoses the HTML). And a <span runat=server> doesn''t like nested


TR''s.


I just need some "wrapper" server control that can contain anything (HTML and Server controls) without rendering ANY HTML on any browser. Seems


like

this would be widely used (and needed) feature, but I haven''t had much


luck

finding such a thing.

Any suggestions would be appreciated.

Thanks in advance for your help!
Jerad




这篇关于动态显示/隐藏TR的组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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