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);
- }
- });
- });
- }
- }
- @foreach (var item in Model)
- {
-
"[email protected]" onclick="return passproductid.passid()" class="edit_product"> but getting this error,
How can I solve this?2 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions01ForumsTop experts
Arun PottiAnswers in the forums20answers02
Tahir AnsariAnswers in the forums5answers03
Kamlesh KumarAnswers in the forums5answers04
Sam HobbsAnswers in the forums4answers05
Željko PerićAnswers in the forums3answersFull leaderboard →
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister

Vignesh ManiRank #98 · 22.1K reputationPosted Jan 10, 2017, 3:29 AM EST
deva sahuRank #7,345 · 243 reputationPosted Sep 4, 2019, 6:05 PM EDT