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
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Abhilash J A
536
2.4k
596.4k
The id is not defined jquery error MVC 5
Jan 10 2017 4:01 AM
Hello every one,
I am working on mvc5 with visual studio 2015. I am using products.js file and called this products.js file on _Layout.cshtml page as shown below,
I have added this jquery code,
passproductid = {
passid:
function
() {
$(
'.edit_product'
).on(
'click'
,
function
(e) {
debugger
;
var
_productId = $(
this
).attr(
'id'
);
$.ajax({
url:
'/ProductCategory/GetProducts/'
,
type:
"POST"
,
data: { productid: _productId.substring(10) },
success:
function
(data) {
$(
'#divresult'
).html(data);
}
});
});
}
}
after I have called this jquery function throught table tr click to get row id like this,
@foreach (
var
item
in
Model)
{
<tr id=
"
[email protected]
"
onclick=
"return passproductid.passid()"
class
=
"edit_product"
>
but getting this error,
How can I solve this?
Reply
Answers (
2
)
How to append the array to a legend in Jqplot?
Load the link in a div tag