Click here to Skip to main content
15,885,757 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: .i cant select master page as well as place code n seperate file textbox in vs 2008. Pin
jkirkerx10-Jan-13 12:54
professionaljkirkerx10-Jan-13 12:54 
QuestionStart Up for Project Required Pin
Ziad Aslam8-Jan-13 19:31
Ziad Aslam8-Jan-13 19:31 
AnswerRe: Start Up for Project Required Pin
Richard MacCutchan8-Jan-13 20:58
mveRichard MacCutchan8-Jan-13 20:58 
GeneralRe: Start Up for Project Required Pin
Ziad Aslam8-Jan-13 21:26
Ziad Aslam8-Jan-13 21:26 
GeneralRe: Start Up for Project Required Pin
Richard MacCutchan8-Jan-13 22:48
mveRichard MacCutchan8-Jan-13 22:48 
AnswerRe: Start Up for Project Required Pin
J4amieC9-Jan-13 0:42
J4amieC9-Jan-13 0:42 
GeneralRe: Start Up for Project Required Pin
Ziad Aslam9-Jan-13 1:07
Ziad Aslam9-Jan-13 1:07 
QuestionMVC 4.0 and JQuery .ajax Pin
AnalogNerd8-Jan-13 8:50
AnalogNerd8-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:
C#
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:
C#
[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 :
JavaScript
$.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:

C#
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
sheshagirirao N7-Jan-13 23:25 
AnswerRe: Sample project ajax file upload with progress bar Pin
Sandeep Mewara8-Jan-13 3:05
mveSandeep Mewara8-Jan-13 3:05 
QuestionGrouping Columns in Grid View Pin
AmitTalekar7-Jan-13 20:45
AmitTalekar7-Jan-13 20:45 
AnswerRe: Grouping Columns in Grid View Pin
Sandeep Mewara7-Jan-13 20:58
mveSandeep Mewara7-Jan-13 20:58 
GeneralRe: Grouping Columns in Grid View Pin
AmitTalekar7-Jan-13 22:54
AmitTalekar7-Jan-13 22:54 
QuestionHow to make gridview coloum in hyperlink and get the values in lightbox Pin
Krishna Varadharajan7-Jan-13 2:26
Krishna Varadharajan7-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
mveSandeep Mewara7-Jan-13 2:57 
GeneralRe: How to make gridview coloum in hyperlink and get the values in lightbox Pin
Krishna Varadharajan7-Jan-13 4:23
Krishna Varadharajan7-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
piyush_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
David Mujica8-Jan-13 3:48 
QuestionBrowser Compatibilty Pin
RavitejaPammi6-Jan-13 23:54
RavitejaPammi6-Jan-13 23:54 
AnswerRe: Browser Compatibilty Pin
Sandeep Mewara7-Jan-13 2:53
mveSandeep Mewara7-Jan-13 2:53 
GeneralRe: Browser Compatibilty Pin
RavitejaPammi17-Jan-13 20:21
RavitejaPammi17-Jan-13 20:21 
GeneralRe: Browser Compatibilty Pin
Sandeep Mewara17-Jan-13 23:50
mveSandeep Mewara17-Jan-13 23:50 
GeneralJavaScript - window.print() not working in Android mobile browsers Pin
RavitejaPammi23-Jan-13 23:08
RavitejaPammi23-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
cawboy_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
mveSandeep Mewara6-Jan-13 21:26 

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.