15,902,635 members
Sign in
Sign in
Email
Password
Forgot your password?
Sign in with
home
articles
Browse Topics
>
Latest Articles
Top Articles
Posting/Update Guidelines
Article Help Forum
Submit an article or tip
Import GitHub Project
Import your Blog
quick answers
Q&A
Ask a Question
View Unanswered Questions
View All Questions
View C# questions
View C++ questions
View Javascript questions
View Visual Basic questions
View Python questions
discussions
forums
CodeProject.AI Server
All Message Boards...
Application Lifecycle
>
Running a Business
Sales / Marketing
Collaboration / Beta Testing
Work Issues
Design and Architecture
Artificial Intelligence
ASP.NET
JavaScript
Internet of Things
C / C++ / MFC
>
ATL / WTL / STL
Managed C++/CLI
C#
Free Tools
Objective-C and Swift
Database
Hardware & Devices
>
System Admin
Hosting and Servers
Java
Linux Programming
Python
.NET (Core and Framework)
Android
iOS
Mobile
WPF
Visual Basic
Web Development
Site Bugs / Suggestions
Spam and Abuse Watch
features
features
Competitions
News
The Insider Newsletter
The Daily Build Newsletter
Newsletter archive
Surveys
CodeProject Stuff
community
lounge
Who's Who
Most Valuable Professionals
The Lounge
The CodeProject Blog
Where I Am: Member Photos
The Insider News
The Weird & The Wonderful
help
?
What is 'CodeProject'?
General FAQ
Ask a Question
Bugs and Suggestions
Article Help Forum
About Us
Search within:
Articles
Quick Answers
Messages
Comments by Abdul Muneeb Abbasi (Top 12 by date)
Abdul Muneeb Abbasi
20-Aug-14 5:18am
View
Do you know Stub/Shimming?
All I am asking is in .fakes assembly, how can I filter a generic class.
Abdul Muneeb Abbasi
5-Mar-14 8:08am
View
Any suggestions please?
Abdul Muneeb Abbasi
14-Apr-13 6:23am
View
Hino still not working. Works fine when there are no arguments passed.
Abdul Muneeb Abbasi
12-Apr-13 11:45am
View
any suggestions
Abdul Muneeb Abbasi
12-Apr-13 10:11am
View
It works fine when I take out the parameter. I have debugged the code seems like the argument is not getting passed to controller
Abdul Muneeb Abbasi
12-Apr-13 6:44am
View
url: '/Home/GetProductData',
This is what comes when I check view source.
Abdul Muneeb Abbasi
12-Apr-13 5:08am
View
I tried document.getElementById and it works fine.
I have changed to productID but I think jquery does not send request. I have tried to debug but it just falls off the call.
Any suggestions
Abdul Muneeb Abbasi
11-Apr-13 13:44pm
View
any suggestions please?
Abdul Muneeb Abbasi
11-Apr-13 12:02pm
View
Ok Little bit success there are two problems in it now
1. I had to remove argument from controller. I tried with hardcoded value and controller returns the proper code.
2. I debugged through Internet Explorer development tools. I am retrieving value in view side but it is not renderred in the text field.
any suggestions
Abdul Muneeb Abbasi
11-Apr-13 10:24am
View
View - Script
<script type="text/javascript">
$(document).ready(function () {
$("#ProductList").change(function () {
var f = $("form");
f.submit(function () {
var productData = f.serialize();
$.post(f.attr("action"), productData, function (result, status) {
if (result !== null) {
$("#productCode").text(result.ProductCode);
}
else {
alert('Invalid ID');
}
});
});
});
});
</script>
Controller
public JsonResult GetProductData(int productID)
{
Product product = Product.GetProduct(productID);
if (product != null)
{
return Json(new { product });
}
return Json(new { product });
}
NOT WORKING
Can any one help me please?
Abdul Muneeb Abbasi
11-Apr-13 9:16am
View
Deleted
I have tried the above. I can now see the Jquery is calling the method onchange but still I am not getting any value.
can any one help me please?
VIEW-JQUERY
$(document).ready(function () {
$("#ProductList").change(function () {
var f = $("form");
f.submit(function () {
var productData = f.serialize();
$.post(f.attr("action"), productData, function (result, status) {
if (result !== null) {
$("#productName").text(result.productName);
}
else {
alert('Invalid ID');
}
});
});
});
});
CONTROLLER
[HttpPost]
public JsonResult GetProductData(string productID)
{
Product product = Product.GetProduct(Convert.ToInt32(productID));
if (product != null)
{
return Json(new { product });
}
return Json(new { product });
}
Abdul Muneeb Abbasi
10-Apr-13 10:30am
View
I have tried onChange. that did not work. I have tried change method. that did not work and no errors in explorer
Show More