在ASP.Net中创建动态链接按钮 [英] Creating Dynamic Link button in ASP.Net

查看:89
本文介绍了在ASP.Net中创建动态链接按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建一个链接按钮取决于数据库字段。如果数据库字段包含值,则将创建链接按钮并获取数据库字段的文本。如果数据库字段为空,则无需创建链接按钮。

i试过这个



 Dim lk As LinkBut​​ton 
Dim br As HtmlGenericControl
对于索引As Integer = 1到10
lk = New LinkBut​​ton
lk.ID = index
lk.Text = index
pnlAttachment.Controls.Add(lk)





无效。

我找到解决方案

解决方案

请查看下面的链接。可以帮到你。 :)



在ASP.Net中创建动态按钮LinkBut​​ton



在ASP.Net/VB.Net中动态添加链接按钮

I want to Create a link Button Depends on Database field.if the Database filed contains value the n the link button will be created and get the text of database field.if the database field is null no need to create the link button.
i tried this

Dim lk As LinkButton
        Dim br As HtmlGenericControl
        For index As Integer = 1 To 10
            lk = New LinkButton
            lk.ID = index
            lk.Text = index
            pnlAttachment.Controls.Add(lk)



its not working.
Suugest me to Get the Solution

解决方案

Please check below links.May be helped to you. :)

Creating Dynamic Button LinkButton in ASP.Net

Dynamically add link buttons in ASP.Net/VB.Net)


这篇关于在ASP.Net中创建动态链接按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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