Click here to Skip to main content
12,403,418 members (75,468 online)
   

ASP.NET

 
AnswerRe: Disable Pop-up Blocker Pin
jkirkerx10-Jan-13 12:46
memberjkirkerx10-Jan-13 12:46 
AnswerRe: Disable Pop-up Blocker Pin
Richard MacCutchan10-Jan-13 21:54
mvpRichard MacCutchan10-Jan-13 21:54 
GeneralRe: Disable Pop-up Blocker Pin
arunmisra11-Jan-13 11:22
memberarunmisra11-Jan-13 11:22 
JokeRe: Disable Pop-up Blocker Pin
jkirkerx13-Jan-13 13:31
memberjkirkerx13-Jan-13 13:31 
Question.i cant select master page as well as place code n seperate file textbox in vs 2008. Pin
Member 97128329-Jan-13 22:48
memberMember 97128329-Jan-13 22:48 
AnswerRe: .i cant select master page as well as place code n seperate file textbox in vs 2008. Pin
Sandeep Mewara10-Jan-13 3:07
mvpSandeep Mewara10-Jan-13 3:07 
AnswerRe: .i cant select master page as well as place code n seperate file textbox in vs 2008. Pin
jkirkerx10-Jan-13 12:54
memberjkirkerx10-Jan-13 12:54 
QuestionStart Up for Project Required Pin
Ziad Aslam8-Jan-13 19:31
memberZiad Aslam8-Jan-13 19:31 
AnswerRe: Start Up for Project Required Pin
Richard MacCutchan8-Jan-13 20:58
mvpRichard MacCutchan8-Jan-13 20:58 
GeneralRe: Start Up for Project Required Pin
Ziad Aslam8-Jan-13 21:26
memberZiad Aslam8-Jan-13 21:26 
GeneralRe: Start Up for Project Required Pin
Richard MacCutchan8-Jan-13 22:48
mvpRichard MacCutchan8-Jan-13 22:48 
AnswerRe: Start Up for Project Required Pin
J4amieC9-Jan-13 0:42
memberJ4amieC9-Jan-13 0:42 
GeneralRe: Start Up for Project Required Pin
Ziad Aslam9-Jan-13 1:07
memberZiad Aslam9-Jan-13 1:07 
QuestionMVC 4.0 and JQuery .ajax Pin
AnalogNerd8-Jan-13 8:50
memberAnalogNerd8-Jan-13 8:50 
I'm trying to do a post back to a controller with $.ajax and all I get in the controller is null for my object.

Here's my setup for the class:
public class ApplicationLinkViewModel : MappableModel
   {
       public string ApplicationLinkId { get; set; }
 
       public string ApplicationId { get; set; }
 
       public string DisplayText { get; set; }
 
       public string Link { get; set; }
   }

And for the controller:
[HttpPost]
       public JsonResult SaveLink(ApplicationLinkViewModel link)
       {
         var responseModel = new ResponseModel();
         return this.Json(responseModel);
       }

As you can see I'm doing nothing in the controller right now, I just have two lines so I can set a breakpoint and check out the link variable which is always null.

The JQuery function is :
$.ajax({
        type: "POST",
        cache: false,
        dataType: 'json',
        url: "Item/SaveLink",
        data: JSON.stringify({ ApplicationId : "1", DisplayText: "test", Link : "linked", ApplicationLinkId: "2" }),
        contentType: 'application/json; charset=utf-8',
        success: function(data) {
            if (data.Success) {
                window.searchApplications();
                window.showDetails(applicationId);
            }
        },
        error: function(data) {
            alert("Error occurred : \n\n" + data.Message);
        }
    });

I've tried several other approaches, and nothing I do seems to work, the object passed into my controlled is always null.

Does anyone have any ideas? For what it is worth I am (stuck) using IE8.


EDIT: SOLVED
I'm going to go drown myself now. The problem was the name of my parameter "link". It must be reserved or something even though the code never complained. At any rate I changed my Controller to this and it works now:

public JsonResult SaveLink(ApplicationLinkViewModel linkViewModel


modified 8-Jan-13 15:50pm.

QuestionSample project ajax file upload with progress bar Pin
sheshagirirao N7-Jan-13 23:25
membersheshagirirao N7-Jan-13 23:25 
AnswerRe: Sample project ajax file upload with progress bar Pin
Sandeep Mewara8-Jan-13 3:05
mvpSandeep Mewara8-Jan-13 3:05 
QuestionGrouping Columns in Grid View Pin
AmitTalekar7-Jan-13 20:45
memberAmitTalekar7-Jan-13 20:45 
AnswerRe: Grouping Columns in Grid View Pin
Sandeep Mewara7-Jan-13 20:58
mvpSandeep Mewara7-Jan-13 20:58 
GeneralRe: Grouping Columns in Grid View Pin
AmitTalekar7-Jan-13 22:54
memberAmitTalekar7-Jan-13 22:54 
QuestionHow to make gridview coloum in hyperlink and get the values in lightbox Pin
krishnavaradharajan7-Jan-13 2:26
memberkrishnavaradharajan7-Jan-13 2:26 
AnswerRe: How to make gridview coloum in hyperlink and get the values in lightbox Pin
Sandeep Mewara7-Jan-13 2:57
mvpSandeep Mewara7-Jan-13 2:57 
GeneralRe: How to make gridview coloum in hyperlink and get the values in lightbox Pin
krishnavaradharajan7-Jan-13 4:23
memberkrishnavaradharajan7-Jan-13 4:23 
AnswerRe: How to make gridview coloum in hyperlink and get the values in lightbox Pin
piyush_dobariya7-Jan-13 18:41
memberpiyush_dobariya7-Jan-13 18:41 
AnswerRe: How to make gridview coloum in hyperlink and get the values in lightbox Pin
David Mujica8-Jan-13 3:48
memberDavid Mujica8-Jan-13 3:48 
QuestionBrowser Compatibilty Pin
ravitejapammi6-Jan-13 23:54
memberravitejapammi6-Jan-13 23:54 
AnswerRe: Browser Compatibilty Pin
Sandeep Mewara7-Jan-13 2:53
mvpSandeep Mewara7-Jan-13 2:53 
GeneralRe: Browser Compatibilty Pin
ravitejapammi17-Jan-13 20:21
memberravitejapammi17-Jan-13 20:21 
GeneralRe: Browser Compatibilty Pin
Sandeep Mewara17-Jan-13 23:50
mvpSandeep Mewara17-Jan-13 23:50 
GeneralJavaScript - window.print() not working in Android mobile browsers Pin
ravitejapammi23-Jan-13 23:08
memberravitejapammi23-Jan-13 23:08 
QuestionHow can I delete a Column of XLSX file with EPPlus in web application? Pin
cawboy_iran6-Jan-13 20:00
membercawboy_iran6-Jan-13 20:00 
AnswerRe: How can I delete a Column of XLSX file From EPPlus in web application? Pin
Sandeep Mewara6-Jan-13 21:26
mvpSandeep Mewara6-Jan-13 21:26 
GeneralRe: How can I delete a Column of XLSX file From EPPlus in web application? Pin
cawboy_iran7-Jan-13 2:48
membercawboy_iran7-Jan-13 2:48 
QuestionWoW Slider now showing the image Pin
Jassim Rahma5-Jan-13 8:06
memberJassim Rahma5-Jan-13 8:06 
AnswerRe: WoW Slider now showing the image Pin
Sandeep Mewara5-Jan-13 20:09
mvpSandeep Mewara5-Jan-13 20:09 
QuestionUnable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox Pin
amsedky5-Jan-13 1:00
memberamsedky5-Jan-13 1:00 
AnswerRe: Unable to cast object of type 'System.Web.UI.LiteralControl' to type 'System.Web.UI.WebControls.TextBox Pin
Sandeep Mewara5-Jan-13 20:24
mvpSandeep Mewara5-Jan-13 20:24 
Questiondisplay animated image while save data to asp.net Pin
ashraf almashhari4-Jan-13 21:46
memberashraf almashhari4-Jan-13 21:46 
AnswerRe: display animated image while save data to asp.net Pin
Sandeep Mewara4-Jan-13 22:14
mvpSandeep Mewara4-Jan-13 22:14 
QuestionAsp.net Pin
Manjunath Hegde4-Jan-13 0:41
memberManjunath Hegde4-Jan-13 0:41 
AnswerRe: Asp.net Pin
Rahul Rajat Singh4-Jan-13 1:04
memberRahul Rajat Singh4-Jan-13 1:04 
QuestionInsert/Update/Delete Records in Dynamic Generated Textbox/Checkbox and Loop Through All Records Pin
guodl3-Jan-13 10:11
memberguodl3-Jan-13 10:11 
Questionlive update Pin
Subin Mavunkal3-Jan-13 2:23
memberSubin Mavunkal3-Jan-13 2:23 
AnswerRe: live update Pin
Keith Barrow3-Jan-13 2:46
mentorKeith Barrow3-Jan-13 2:46 
AnswerRe: live update Pin
Rahul Rajat Singh3-Jan-13 22:04
memberRahul Rajat Singh3-Jan-13 22:04 
QuestionHow to populate WoW Slider from database Pin
Jassim Rahma1-Jan-13 8:32
memberJassim Rahma1-Jan-13 8:32 
QuestionUmbarco or Joomla? Pin
Jassim Rahma31-Dec-12 23:58
memberJassim Rahma31-Dec-12 23:58 
AnswerRe: Umbarco or Joomla? Pin
Rahul Rajat Singh3-Jan-13 21:51
memberRahul Rajat Singh3-Jan-13 21:51 
AnswerRe: Umbarco or Joomla? Pin
deflinek8-Jan-13 2:55
memberdeflinek8-Jan-13 2:55 
QuestionSlideShow Control Pin
cdpsource31-Dec-12 1:19
membercdpsource31-Dec-12 1:19 
AnswerRe: SlideShow Control Pin
jkirkerx31-Dec-12 10:23
memberjkirkerx31-Dec-12 10:23 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.


Advertise | Privacy | Mobile
Web01 | 2.8.160721.1 | Last Updated 28 Jul 2016
Copyright © CodeProject, 1999-2016
All Rights Reserved. Terms of Service
Layout: fixed | fluid