English 中文(简体)
能否将另一个要素(但顿)列入核对箱清单项目?
原标题:Is it possible to put another element (button) inside a Checkboxlist Item?

我有一个通过数据Source(每个有其价值的人都来自一个数据库,因此我可以在数据库中编印任何内容),而我需要添加一个子,以便在发生某些事件时,在检查BoxList特定项目的右侧详细说明。

能够这样做? 如何?

最佳回答

<代码>每一项目 CheckBoxList为 反对。 这些遗产从<条码>Control中继承,因此没有自己的ControlCollection。 这意味着,您可在项目上添加一个链接栏或<代码>Button。

如果以<代码>Control的物体为基础,请在OnDataBound上查找<编码>>的条目,并在发现需要该纽扣吨的物项之前通过这些物项。 从那以后,你能够把控制(但顿)增列到每个项目<代码>。 控制收集。 但是,由于名单项目没有这种功能,你会再次受到限制。

详细情况如何? 如果只是一个客户方,那么你可以将html注入<代码>ListItem的文本财产,尽管我没有核实这一工程:

foreach (ListItem item in myCheckBoxList)
{
     item.Text += "&nbsp;<input type="button"/>";
}

无论是哪一种方式,它都胜过,你也许会更好地建立简单的用户控制。 在控制方面,你仍然可以使用一种检查BoxList,但你可以积极向用户Control增加超链接或Buttons。 你们可以利用特别安全局或其他手段,在适当的地点排出 but子。

问题回答

如果你想这样做,你必须写上习惯用户控制。





相关问题
Anyone feel like passing it forward?

I m the only developer in my company, and am getting along well as an autodidact, but I know I m missing out on the education one gets from working with and having code reviewed by more senior devs. ...

How to Add script codes before the </body> tag ASP.NET

Heres the problem, In Masterpage, the google analytics code were pasted before the end of body tag. In ASPX page, I need to generate a script (google addItem tracker) using codebehind ClientScript ...

Transaction handling with TransactionScope

I am implementing Transaction using TransactionScope with the help this MSDN article http://msdn.microsoft.com/en-us/library/system.transactions.transactionscope.aspx I just want to confirm that is ...

System.Web.Mvc.Controller Initialize

i have the following base controller... public class BaseController : Controller { protected override void Initialize(System.Web.Routing.RequestContext requestContext) { if (...

Microsoft.Contracts namespace

For what it is necessary Microsoft.Contracts namespace in asp.net? I mean, in what cases I could write using Microsoft.Contracts;?

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签