使用图像按钮编辑,更新,删除asp.net中的网格视图 [英] using image buttons for edit,update,delete Grid view in asp.net

查看:85
本文介绍了使用图像按钮编辑,更新,删除asp.net中的网格视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经为命令更新,删除,编辑,添加新记录提供了图像按钮。

I have given image buttons for the command Update,Delete,edit,add new record..

<asp:TemplateField>
<EditItemTemplate>
<asp:ImageButton ID="imgbtnUpdate" CommandName="Update" runat="server" ImageUrl="~/App_Data/images/update.jpeg" ToolTip="Update" Height="20px" Width="20px" />
<asp:ImageButton ID="imgbtnCancel" runat="server" CommandName="Cancel" ImageUrl="~/App_Data/images/cancel.jpeg" ToolTip="Cancel" Height="20px" Width="20px" />
</EditItemTemplate>
<ItemTemplate>
    
<asp:ImageButton ID="imgbtnEdit" CommandName="Edit" runat="server" ImageUrl="~/App_Data/images/edit.jpeg" ToolTip="Edit" Height="20px" Width="20px" />
<asp:ImageButton ID="imgbtnDelete" CommandName="Delete" Text="Edit" runat="server" ImageUrl="~/App_Data/images/delete.jpeg" ToolTip="Delete" Height="20px" Width="20px" />
</ItemTemplate>
<FooterTemplate>
<asp:ImageButton ID="imgbtnAdd" runat="server" ImageUrl="~/App_Data/images/addnewitem.jpeg"  CommandName="AddNew" Width="30px" Height="30px" ToolTip="Add new User"/>
</FooterTemplate>
</asp:TemplateField>



但是在运行时没有显示图像按钮,而是显示标签提交查询.... ??? ???


but at the run time the image buttons are not being displayed,instead a label Submit Query is being displayed....???????

推荐答案

App_Data文件夹是为数据库文件等数据保留的特殊文件夹,不会在Web上呈现任何内容。这是设计的,有意的,无法改变。



您的图像绝对不属于App_Data子文件夹 - 将它们放入/ images文件夹或更合适的位置。
The App_Data folder is a special folder reserved for data such as database files and so on, and will NOT render out any contents on the web. This is by design, and intentional and cannot be changed.

Your images do definitely not belong into the App_Data subfolder - put them into a /images folder or something more appropriate.




将图像从 App_Data 文件夹移动到不同的目录(如图像)。 App_Data 文件夹用于数据库类和文件(如:mdf)。





--Amit
Hi,
Move your images from App_Data folder to different directory(like Images). App_Data folder is used for database classes and files(like: mdf).


--Amit


这篇关于使用图像按钮编辑,更新,删除asp.net中的网格视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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