Tech
News
Videos
Forums
Jobs
Books
Events
More
Interviews
Live
Learn
Training
Career
Members
Blogs
Challenges
Certification
Contribute
Article
Blog
Video
Ebook
Interview Question
.NET
.NET Core
.NET MAUI
.NET Standard
Active Directory
ADO.NET
Agile Development
AI
AJAX
AlbertAGPT
Alchemy
Alexa Skills
Algorand
Algorithms in C#
Android
Angular
ArcObject
ASP.NET
ASP.NET Core
Augmented Reality
Avalanche
AWS
Azure
Backbonejs
Big Data
BizTalk Server
Blazor
Blockchain
Bootstrap
Bot Framework
Business
Business Intelligence(BI)
C#
C# Corner
C# Strings
C, C++, MFC
Career Advice
Careers and Jobs
Chapters
ChatGPT
Cloud
Coding Best Practices
Cognitive Services
COM Interop
Compact Framework
Copilot
Cortana Development
Cosmos DB
Cryptocurrency
Cryptography
Crystal Reports
CSS
Current Affairs
Custom Controls
Cyber Security
Data Mining
Data Science
Databases & DBA
Databricks
Design Patterns & Practices
DevExpress
DevOps
DirectX
Dynamics CRM
Enterprise Development
Entity Framework
Error Zone
Exception Handling
F#
Files, Directory, IO
Flutter
Games Programming
GDI+
General
Generative AI
GO
Google Cloud
Google Development
Graphics Design
Graphite Studio
Hardware
Hiring and Recruitment
HoloLens
How do I
HTML 5
Infragistics
Internet & Web
Internet of Things
Ionic
Java
Java and .NET
JavaScript
JQuery
JSON
JSP
Knockout
Kotlin
Langchain
Leadership
Learn .NET
Learn iOS Programming
LINQ
Machine Learning
Metaverse
Microsoft 365
Microsoft Fabric
Microsoft Office
Microsoft Phone
Microsoft Teams
Mobile Development
MongoDB
MuleSoft
MySQL
NEAR
NetBeans
Networking
NFT
NoCode LowCode
Node.js
Office Development
OOP/OOD
Open Source
Operating Systems
Oracle
Outsourcing
Philosophy
PHP
Polygon
PostgreSQL
Power Apps
Power Automate
Power BI
Power Pages
Printing in C#
Products
Progress
Progressive Web Apps
Project Management
Public Speaking
Python
Q#
QlikView
Quantum Computing
R
React
React Native
Reports using C#
Robotics & Hardware
RPA
Ruby on Rails
RUST
Salesforce
Security
Servers
ServiceNow
SharePoint
Sharp Economy
SignalR
Smart Devices
Snowflake
Software Architecture/Engineering
Software Testing
Solana
Solidity
Sports
SQL
SQL Server
Startups
Stratis Blockchain
Swift
SyncFusion
Threading
Tools
TypeScript
Unity
UWP
Visual Basic .NET
Visual Studio
Vue.js
WCF
Wearables
Web API
Web Design
Web Development
Web3
Windows
Windows Controls
Windows Forms
Windows PowerShell
Windows Services
Workflow Foundation
WPF
Xamarin
XAML
XML
XNA
XSharp
Register
Login
4
Answers
using jquery Model pop data not show on textbox
zeeshan akram
4y
620
1
Reply
How to show data in model pop , i also put the break point and check data , data is show and pass but not show on the text box . any expert can you tell me where i am wrong .
<
div
class
=
"modal-body"
>
<
div
class
=
"row"
>
<
div
class
=
"col-md-12"
>
<
div
class
=
"panel widget"
>
<
div
class
=
"panel-body"
>
<
form
class
=
"form-horizontal"
action
=
"#"
role
=
"form"
>
<
div
class
=
"panel-heading vd_bg-grey"
>
<
h3
class
=
"panel-title"
>
<
span
class
=
"menu-icon"
>
<
i
class
=
"fa fa-bar-chart-o"
>
</
i
>
</
span
>
Products Info
</
h3
>
</
div
>
<
br
/>
<
div
class
=
"row"
>
<
div
class
=
"col-md-4"
>
<
label
class
=
"col-xs-3 control-label"
>
Name
</
label
>
<
div
class
=
"controls col-xs-9"
>
<
input
type
=
"text"
placeholder
=
"Product Name"
name
=
""
class
=
"input-border-btm"
id
=
"PName"
>
</
div
>
</
div
>
<
div
class
=
"col-md-4"
>
<
label
class
=
"col-xs-3 control-label"
>
Model
</
label
>
<
div
class
=
"controls col-xs-9"
>
<
input
type
=
"text"
placeholder
=
"Model"
name
=
"Model"
id
=
"Model"
class
=
"input-border-btm"
>
</
div
>
</
div
>
</
div
>
</
div
>
<!-- Panel Widget -->
</
div
>
<!-- col-md-12 -->
</
div
>
<
div
class
=
"modal-footer"
>
<
button
type
=
"button"
class
=
"btn btn-secondary"
data-dismiss
=
"modal"
>
Close
</
button
>
<
button
type
=
"button"
class
=
"btn btn-primary"
id
=
"btnUpdate"
style
=
"display:none;"
>
Update
</
button
>
<
button
type
=
"button"
class
=
"btn btn-primary"
id
=
"btnSave"
>
Save changes
</
button
>
</
div
>
</
form
>
</
div
>
</
div
>
<!-- Panel Widget -->
</
div
>
<!-- col-md-12 -->
</
div
>
</
div
>
</
div
>
Function in Jquery
function
GetProductByID(ID)
{
$(
'#PName'
).css(
'border-color'
,
'lightgrey'
);
$(
'#Model'
).css(
'border-color'
,
'lightgrey'
);
$(
'#Condition'
).css(
'border-color'
,
'lightgrey'
);
$.ajax({
url:
"/Items/GetProd/"
+ ID,
typr:
"GET"
,
contentType:
"application/json;charset=UTF-8"
,
dataType:
"json"
,
success:
function
(result) {
$(
'#PName'
).val(result.PName);
$(
'#Model'
).val(result.Model);
$(
'#mproduct'
).modal(
'show'
);
$(
'#btnUpdate'
).show();
$(
'#btnSave'
).hide();
},
error:
function
(errormessage) {
alert(errormessage.responseText);
}
});
return
false
;
}
Jquery Datatable
<script type=
"text/javascript"
>
$(document).ready(
function
() {
mProductList();
});
//Load Data function
function
mProductList() {
$(
"#productlist"
).DataTable({
"processing"
:
true
,
"serverSide"
:
true
,
"filter"
:
true
,
"orderMulti"
:
false
,
"stripeClasses"
: [
'odd-row'
,
'even-row'
],
"ajax"
: {
"url"
:
"/Items/Product_List"
,
"type"
:
"POST"
,
"datatype"
:
"json"
},
"columnDefs"
:
[{
"targets"
: [0],
"visible"
:
false
,
"searchable"
:
false
}],
"columns"
: [
{
"data"
:
"ProductID"
,
"name"
:
"ProductID"
,
"autoWidth"
:
true
},
{
"data"
:
"PName"
,
"name"
:
"PName"
,
"autoWidth"
:
true
},
{
"data"
:
"Model"
,
"name"
:
"Model"
,
"autoWidth"
:
true
},
{
"data"
:
"Condition"
,
"name"
:
"Condition"
,
"autoWidth"
:
true
},
{
"data"
:
"UnitPrice"
,
"name"
:
"UnitPrice"
,
"autoWidth"
:
true
},
{
"data"
:
"Discount"
,
"name"
:
"Discount"
,
"autoWidth"
:
true
},
{
"data"
:
"ProductSize"
,
"name"
:
"ProductSize"
,
"autoWidth"
:
true
},
{
"data"
:
"ProductColor"
,
"name"
:
"ProductColor"
,
"autoWidth"
:
true
},
{
"data"
:
"ProductType"
,
"name"
:
"ProductType"
,
"autoWidth"
:
true
},
{
"data"
:
"UnitInStock"
,
"name"
:
"UnitInStock"
,
"autoWidth"
:
true
},
{
data:
null
, render:
function
(data, type, row) {
return
"<a href='#' class='btn btn-sm btn-info' onclick=GetProductByID('"
+ row.ProductID +
"'); ><i class='fa fa-eye'></i></a>"
;
}
},
]
});
}
function
public
JsonResult GetProd(
int
id)
{
ECommercedbEntities db =
new
ECommercedbEntities();
var productl = (from p
in
db.Products
where p.ProductID == id
select
new
{
PName = p.PName,
PDescription = p.PDescription,
Model = p.Model,
}).FirstOrDefault();
var productD = (from pd
in
db.ProductDetails
join p
in
db.Products on pd.ProductID equals p.ProductID
where pd.ProductID == id
select
new
{
ProductID = pd.ProductID,
OS = pd.OS,
ProcessorType = pd.ProcessorType,
RAM = pd.RAM,
ScreenSize = pd.ScreenSize,
TouchScreen = pd.TouchScreen,
BatteryLife = pd.BatteryLife,
Camera = pd.Camera
}).ToList();
return
Json(
new
{ productl, productD }, JsonRequestBehavior.AllowGet);
//var plist= _IProducts.GetProductByID(id);
}
Post
Reset
Cancel
Answers (
4
)
Next Recommended Forum
complete source code of uploading video in grid
Looking for help with WinForms Performance issue resizing co