如何在aspx页面后面或页面中的代码中创建LinkButtons数组 [英] how to create array of LinkButtons in code behind or in aspx page
本文介绍了如何在aspx页面后面或页面中的代码中创建LinkButtons数组的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个表,其列值类似"9:00-10:00,10:30-12:00",我用<,>
对其进行了拼接
对于每个元素,我必须创建LinkButton,这些按钮将向最终用户显示...任何人都可以帮忙....
i have a table with column value like "9:00-10:00,10:30-12:00" i splicted this by <,>
for each element i have to create LinkButton and these buttons will going to show to end user......can anybody help out in this please....
推荐答案
到目前为止,您还尝试了什么吗?
步骤:
1.拆分表列值以获取时间范围
-使用string.split并将其转储到数组中
2.使用上面的数组,您得到了计数,并在for循环中使用它
-使用新"动态创建链接按钮
-提供一个ID
-根据当前数组索引数据设置文本
-将链接按钮添加到面板/占位符以进行显示
-循环继续.
试试吧!
Did you try anything so far?
Steps:
1. Split the table column value to get the time ranges
- Use string.split and dump it into an array
2. Using above array, you got the count, use it in a for loop
- create link button dynamically using ''new''
- provide it an id
- set the text as per the current array index data
- Add the link button to a panel/placeholder for display
- loop continues.
Try!
这篇关于如何在aspx页面后面或页面中的代码中创建LinkButtons数组的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文