我有一张桌子如下: 上传 CategoryId int 描述nvarchar(50) 路径nvarchar(50) 该类别表示提供描述和路径的文件类别。 ex。一个类别可以是员工,可能有各种员工desc及其文件路径。 现在我想在网格视图中显示这些。在网格视图中,我希望有一个超链接字段,点击后会根据路径下载文件。 ex我用cat员工获取记录。它取了10行。现在我需要的是网格视图中的每一行都有一个链接下载及其相应的路径。 请帮忙!!!
解决方案嘿那里, 查看这些链接,了解如何使用 asp:HyperlinkField : www.ezzylearning/tutorial.aspx?tid=8093456 [ ^ ] 如何在ASP.NET中的gridview中添加超链接 [ ^ ] 如果有帮助请告诉我。 Azee ......
点击此处如何在gridview中添加超链接在ASP.NET中 [ ^ ]
您可以按照以下步骤操作.. 1 。在选定字段列表中添加TemplateField 。 2 。现在右键单击Grid并选择编辑模板。现在在网格的ItemTemplate中删除超链接控件。 3 。现在将超链接的NavigateURL和Text属性绑定到超链接列字段 表使用数据绑定。 4 。现在如果点击超链接,它将带你到那个页面。 < asp:hyperlinkfield datatextfield = LeadID datanavigateurlfields = LeadID datanavigateurlformatstring = LeadInformation.aspx?LeadID = {0} text = 潜在客户ID xmlns:asp = #unknown />
Hi, I have a table as follows: Upload CategoryId int description nvarchar(50) path nvarchar(50) the category indicates the categories of files whose description and path are provided. ex. A category can be employee which might have various employee desc and their file paths. Now i want to show these in grid view. In Grid View , I want to have a Hyperlink Field which on clicking would download the file with respect to the path. ex i fetched records with cat employee. It fetched 10 rows. Now what i need is every row in grid view has a link download with it's respective path. Please help!!!
解决方案 Hey there, Check these links on how to use asp:HyperlinkField: www.ezzylearning/tutorial.aspx?tid=8093456[^] how to add Hyperlink in gridview in ASP.NET[^] Let me know if it helps. Azee...Check here how to add Hyperlink in gridview in ASP.NET[^]you can follows these steps.. 1. Add a TemplateField in the Selected Fields list. 2. Now Right click on the Grid and select Edit Templates. Now drop the Hyperlink control in the ItemTemplate of the Grid. 3. Now bind the NavigateURL and Text property of the Hyperlink to the hyperlink column field in the table using Data Bindings. 4. Now if you click on the hyperlink, it will take you to that page. <asp:hyperlinkfield datatextfield="LeadID" datanavigateurlfields="LeadID" datanavigateurlformatstring="LeadInformation.aspx?LeadID={0}" text="Lead ID" xmlns:asp="#unknown" />更多推荐
如何在asp,net grid视图中显示超链接。
发布评论