0
我有一个asp.net网页,其中包含一系列隐藏的输入字段,用于在提交时将值从客户端传递到代码背景。从代码隐藏遍历DOM
<input type="hidden" id="zorro1" value="somevalue set at runtime from client-side" />
<input type="hidden" id="zorro2" value="somevalue set at runtime from client-side" />
.../...
<input type="hidden" id="zorron" value="somevalue set at runtime from client-side" />
现在我需要从代码隐藏中提取这些值。 我可以写这个丑陋的啄:
dim aValue as string = zorro1.value
dim aValue as string = zorro2.value
.../...
dim aValue as string = zorron.value
它的工作原理,但我想“的FindControl”每个隐藏输入这样的,使用LINQ,在伪代码:
dim inputControls = from c in page.controls where id.startswith("zorro") select s
for each ic in inputControls
aValue = ic.value
aId = ic.ID
next
能有人把我在正确的方向?