{"id":652,"date":"2022-08-30T15:04:55","date_gmt":"2022-08-30T15:04:55","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2013\/11\/09\/namespace-undefined-error-in-javascript-to-execute-ajax-method-from-asp-net-page-collection-of-common-programming-errors\/"},"modified":"2022-08-30T15:04:55","modified_gmt":"2022-08-30T15:04:55","slug":"namespace-undefined-error-in-javascript-to-execute-ajax-method-from-asp-net-page-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2022\/08\/30\/namespace-undefined-error-in-javascript-to-execute-ajax-method-from-asp-net-page-collection-of-common-programming-errors\/","title":{"rendered":"Namespace undefined error in javascript to execute ajax method from asp.net page-Collection of common programming errors"},"content":{"rendered":"<p>I am Using Ajax Pro<\/p>\n<p>I am not getting any error on my machine when i test the web site but getting an error of TimeSheet is undefined (TimeSheet is the namespace) from the hosting.<\/p>\n<p>I get this error in the following cdoe from javascript function<\/p>\n<pre><code>try\n{\nvar response = TimeSheet.DAL.ApexDalc.PopulateDuration(d1, d3);\n}\ncatch(txt)\n{\n alert(txt.message);\n return false;\n}\n\nalert(response.value.Tables[0].Rows[0].Hours);\n<\/code><\/pre>\n<p>I have registered Ajaxpro in the page load with <code>AjaxPro.Utility.RegisterTypeForAjax(typeof(DAL.ApexDalc));<\/code><\/p>\n<p>I have added httphandlers in web.config also:<\/p>\n<pre><code>\n    \n    \n    \n<\/code><\/pre>\n<p>Can you suggest what can be the cause of error in the web site from hosting server?<\/p>\n<p>Thanks<\/p>\n<p id=\"rop\"><small>Originally posted 2013-11-09 21:10:44. <\/small><\/p>","protected":false},"excerpt":{"rendered":"<p>I am Using Ajax Pro I am not getting any error on my machine when i test the web site but getting an error of TimeSheet is undefined (TimeSheet is the namespace) from the hosting. I get this error in the following cdoe from javascript function try { var response = TimeSheet.DAL.ApexDalc.PopulateDuration(d1, d3); } catch(txt) [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-652","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=652"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/652\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}