Click here to Skip to main content
11,806,575 members (40,811 online)
Rate this: bad
Please Sign up or sign in to vote.
This is my Jquery Method
var domain = $(domainId).parent().find("input[name$=whoisdomain]").val();
var params = "{domainname:'" + domain + "'}";
                 type: 'POST',
				 url: '../SearchResult.aspx/GetResult',				 
                 contentType: 'application/json; charset=utf-8',
				 data: params,
                 dataType: 'json',
			     success: AjaxSucceeded,
                 error: AjaxFailed
Server side WebMethod Is:
       [ScriptMethod(ResponseFormat = ResponseFormat.Json)]
       public static List<string> GetResult(string domainname)
          //code is here


{"Message":"Invalid web service call, missing value for parameter: \u0027domainname\u0027.","StackTrace":" at System.Web.Script.Services.WebServiceMethodData.CallMethod(Object target, IDictionary`2 parameters)\r\n at System.Web.Script.Services.WebServiceMethodData.CallMethodFromRawParams(Object target, IDictionary`2 parameters)\r\n at System.Web.Script.Services.RestHandler.InvokeMethod(HttpContext context, WebServiceMethodData methodData, IDictionary`2 rawParams)\r\n at System.Web.Script.Services.RestHandler.ExecuteWebServiceCall(HttpContext context, WebServiceMethodData methodData)","ExceptionType":"System.InvalidOperationException"}

Plz tell me where is the error..this code work fine in all browers except Internet Explorer 10
Posted 12-Jun-13 19:06pm
Edited 12-Jun-13 19:26pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

The data should be
var params = {"domainname":'" + domain + "'};
instead of
var params = "{domainname:'" + domain + "'}";

Hope this helps
RahulRana723 at 13-Jun-13 1:29am
sir,[domain] is variable.which is dynamic not static..i try ur solutions but not working
Jameel Moideen at 13-Jun-13 1:33am
Oops..I have updated my answer.Please try that
RahulRana723 at 13-Jun-13 1:37am
sorry sir,not working
Jameel Moideen at 13-Jun-13 1:40am
is it working in other browsers?
Jameel Moideen at 13-Jun-13 1:43am
can you remove the quotes like '" + domain + "' to {"domainname": domain};
RahulRana723 at 13-Jun-13 1:47am
Not working
RahulRana723 at 13-Jun-13 1:44am
var params = "{domainname:'" + domain + "'}";
This code working fine in all browsers
Jameel Moideen at 13-Jun-13 1:51am
did you try my last comment.
RahulRana723 at 13-Jun-13 1:53am
yes sir.not working in any browsers
ERROR:An error occur{"Message":"Invalid JSON primitive: domainname
Jameel Moideen at 13-Jun-13 1:54am
read the comments in this link.I think u got some information from this..
Jameel Moideen at 13-Jun-13 1:59am
I think it's a IE10 bug
RahulRana723 at 13-Jun-13 2:03am
whats's the solutions? urgently need.plz help
Jameel Moideen at 13-Jun-13 2:10am
Jameel Moideen at 13-Jun-13 2:08am
I don't know exactly what's the pblm..Please read this
Rate this: bad
Please Sign up or sign in to vote.

Solution 2


Try to alert the value of domain .. may be there can be issue in getting domain value

var domain = $(domainId).parent().find("input[name$=whoisdomain]").val();

Hope this helps...
RahulRana723 at 13-Jun-13 3:02am
already try this..this working well

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 ppolymorphe 295
1 OriginalGriff 150
2 George Jonsson 135
3 Richard Deeming 120
4 CPallini 100
0 OriginalGriff 3,380
1 Maciej Los 1,990
2 CPallini 1,915
3 KrunalRohit 1,907
4 ppolymorphe 1,317

Advertise | Privacy | Mobile
Web01 | 2.8.151002.1 | Last Updated 13 Jun 2013
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100