TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
C# Corner
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Image Delete Using Angularjs with ASP.NET
Manish Pipaliya
Apr 29
2015
Code
1.3
k
0
2
facebook
twitter
linkedIn
Reddit
WhatsApp
Email
Bookmark
expand
Js File Code
$scope.Delete =
function
(id) {
for
(i
in
$scope.users) {
if
($scope.users[i].id == id) {
if
($scope.users[i].photo !=
"noimage.jpg"
) {
$.ajax({
type:
"POST"
,
url:
"UsersFormJson.aspx/DeleteImage"
,
contentType:
"application/json; charset=utf-8"
,
data: JSON.stringify({
hid: $scope.users[i].photo
}),
success:
function
(data) {
},
error:
function
() {}
});
}
}
}
};
Asp.net File Code
<Services.WebMethod()>
Public
Shared
Function
DeleteImage(
ByVal
hid
As
String
)
As
String
If
System.IO.File.Exists(
"D:\manish\Project\Project\upload\"
& hid)
Then
System.IO.File.Delete(
"D:\manish\Project\Project\upload\"
& hid)
Else
Return
False
End
If
End
Function
Image Delete Using Angularjs With Asp.net