我如何在asp.net中删除图像 [英] how do i erase image in asp.net

查看:94
本文介绍了我如何在asp.net中删除图像的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的Web应用程序中,我将图像放在imagecontrol中
我拍了一个图像按钮
当我单击imagebutton并在图像上移动鼠标时
那么我需要擦除该图像,所以我要遵循什么代码
擦除表示图像上的特定区域而不是整个图像.
因此,请提供源代码.

in my web application i place a image in imagecontrol
and i took one image button
when i click imagebutton and i move mouse on the image
then i need erase that image so what code i follow
erase means paraticular area on the image not whole image .
so please provide source code.

推荐答案

如果您要擦除"网页中的图片(即从客户端的DOM中删除图片), "您将需要知道图像的ID或图像所在的DIV或SPAN.在脚本中使用该ID可以将其从DOM中删除(或隐藏).如果您使用的是jQuery,它将看起来像这样:

If you want to ''erase'' the image from the web page (I.E. remove it from the DOM on the client) you''ll need to know the ID of the image or the DIV or SPAN that it''s in. Use that ID in script to remove it - or hide it - from the DOM. If you were using jQuery, it would look something like this:


("#your-div").toggle();
("#your-div").toggle();



如果您想将其从服务器上的文件系统中删除,则需要在应用程序中调用一个方法,该方法又调用File.Delete(



If you''re meaning that you want it removed from the file system on the server, you''ll need to call a method in your application that, in turn, makes a call to File.Delete (MSDN docs). This will vary on implementation depending on what version of ASP.NET you''re using and whether or not you''re using the MVC framework.

Finally, you''ll need to make sure that the ASP.NET account on your server has the appropriate permissions on the directory where the image is stored.

Cheers,
-jc


这篇关于我如何在asp.net中删除图像的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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