动态添加HyperLink并向Gridview提供数据 [英] Dynamically add HyperLink and feed the Gridview with data

查看:97
本文介绍了动态添加HyperLink并向Gridview提供数据的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用标题,名称,NavigateURL动态绑定gridview.

您能帮我解决问题吗?

I want to dynamically bind the gridview with Title, Name, NavigateURL.

Can you please help me out to solve the problem.

<asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" Height="145px"

            Width="285px" >
            <Columns>
                <asp:BoundField HeaderText="Title" />
                <asp:BoundField HeaderText="Name" />
                <asp:TemplateField HeaderText="Download">
                    <ItemTemplate>
                        <asp:HyperLink ID="HyperLink2" runat="server" NavigateUrl='<%# Eval("//notepad.txt") %>'>Download</asp:HyperLink>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
        </asp:GridView>

推荐答案

看看这篇文章,对您有帮助:
在C#/ASP.Net中创建动态GridView控件 [可编辑嵌套GridView(多合一) [ ^ ]
Have a look at this article, it will help you out:
Create Dynamic GridView Control in C#/ASP.Net[^]


Just to learn more, do have a look at this article too: Editable Nested GridView (All-in-One)[^]


这篇关于动态添加HyperLink并向Gridview提供数据的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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