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
Schleid Alex
NA
361
48.9k
jquery ajax post passing empty value to controller
Oct 16 2020 12:12 AM
I have this jquery script inside $(document).ready to post data to my database
$(
'#btnSaveStatus'
).on(
'click'
,
function
()
{
//$('#btnSumitChanges').click()
var
stid = $(
'#StoreID'
).val()
var
oStid = $(
'#oldStatus'
).val()
var
ddlID = $(
'#ddlStatusDef'
).val()
var
strUrl = $(
'#txtUrl'
).val()
debugger
;
if
(oStid != ddlID)
{
$.ajax({
url: strUrl,
type:
'POST'
,
contentType:
'apllication/html; charset=utf-8'
,
data:{
'sToreid'
: stid,
'StatusDefid'
: ddlID},
dataType:
'html'
,
success:
function
(result)
{
$(
'#DivStatus'
).modal(
'hide'
);
}
}
)
}
here is my action
public
ActionResult ChangeStoreStatus(
string
sToreid,
string
StatusDefid)
{
}
the sToreid and StatusDefid are null in the action method even though inthe script the value are sent correctly. They're not received Can someone help me find out what is wrong here?
Regards
Reply
Answers (
1
)
Email & Notification Module
Interaction between ASP.NET and C++ executable