I am working on an ASP.net MVC 3.0 Application with razor view engine.
I am making an ajax post as follows:
$.ajax({
type: "post", contentType: "application/json;charset=utf-8",
url: GetErrorCountUrl,
success: function (data) {
});
Here, the URL is as follows:
var GetErrorCountUrl = '@Url.Action("GetErrorCount", "WError", new { Id= "Token", id1 = "Token1", id2= "Token2" })';
GetErrorCountUrl = GetErrorCountUrl.replace('Token',pkid).replace('Token1',cid).replace('Token2',itemclass);
I am building the correct URL . I checked by using alert(url). It is hitting that controller action.
In my controller action,
If i do : Request.params["Id"] --> I was getting the correct value
Reuqest.params["id1"] --> I am getting null values
but, when i do:
reuqest.Params[0] --> correct value
request.params[1] ---> Correct value
I was getting correct values when using index instead of name.
I need get those values based on Parameter name not on index.
Please help.
Except for the first parameter..i was not able to get the values of other parameters