Want to become a Vibe Coder? Join Vibe Coding Training here
x
C# Corner
Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
Collapse
Feed
Dashboard
Wallet
Learn
Achievements
Network
Refer
Rewards
SharpGPT
Premium
Contribute
Article
Blog
Video
Ebook
Interview Question
Register
Login
Image Delete Using Angularjs with ASP.NET
WhatsApp
Manish Pipaliya
Apr 29
2015
1.4
k
0
2
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
Up Next
Image Delete Using Angularjs with ASP.NET