I'm not sure if this belongs on this forum, but if anyone is still using AjaxPro, I'm trying to get it to work with jQuery. I keep getting errors returned similar to this one: null; r.error = {"Message":"word s","Type":"System.NotSupportedException"};/*. Below is the relevant code. Thanks for your help.
C# code: -
using AjaxPro;
-
-
public partial class _Default : System.Web.UI.Page
-
{
-
protected void Page_Load(object sender, EventArgs e)
-
{
-
//load ajax.net files
-
string path = "/ajaxpro/_Default,";
-
path += typeof (_Default).Assembly.FullName.Split(',')[0];
-
path += ".ashx";
-
Page.RegisterHiddenField("ajaxProPath", path);
-
}
-
-
[AjaxPro.AjaxMethod()]
-
public int deleteService(int lineNumber)
-
{
-
return lineNumber;
-
}
-
}
-
.JS Code -
$(document).ready(function()
-
{
-
$("img[@id*=delete]").click(function()
-
{
-
var btnID = $(this).attr('id');
-
btnID = btnID.substring(6, btnID.length);
-
-
if (confirm('Are you sure you want to delete service # ' + btnID + '?'))
-
{
-
$.ajax({
-
type: "POST",
-
url: $("#ajaxProPath").attr('value'),
-
data: {s: btnID},
-
beforeSend: function(xhr)
-
{
-
xhr.setRequestHeader("X-AjaxPro-Method", "deleteService");
-
},
-
success: function(s)
-
{
-
alert(s);
-
}
-
});
-
}
-
});
-
});
-
-
8 5746
Which line triggers that error?
It sounds like the error is occuring in your backend code, since that error is showing a managed(.NET) excepetion code
Which line triggers that error?
It sounds like the error is occuring in your backend code, since that error is showing a managed(.NET) excepetion code
I don't get a detailed error message back; it comes up through the alert box as part of the response. If I had to guess though, it may have something to do with how I'm setting up the data in the JS Code.
JS Code: -
$(document).ready(function()
-
{
-
$("img[@id*=delete]").click(function()
-
{
-
var btnID = $(this).attr('id');
-
btnID = btnID.substring(6, btnID.length);
-
-
if (confirm('Are you sure you want to delete service # ' + btnID + '?'))
-
{
-
$.ajax({
-
type: "POST",
-
url: $("#ajaxProPath").attr('value'),
-
data: {s: btnID},
-
beforeSend: function(xhr)
-
{
-
xhr.setRequestHeader("X-AjaxPro-Method", "deleteService");
-
},
-
success: function(s)
-
{
-
alert(s); // here is where error message is shown
-
}
-
});
-
}
-
});
-
});
-
-
So you can't debug through your server-side code and find any problems?
So you can't debug through your server-side code and find any problems?
I'm not using Visual Studio if that's what you're asking.
I'm not using Visual Studio if that's what you're asking.
Then what are you using? That was clearly c# code (for asp.net) in the first code block.
Then what are you using? That was clearly c# code (for asp.net) in the first code block.
I'm just coding by hand in Dreamweaver.
Well Visual Web Developer has a free edition. You could try using that.
I really think it is a problem in the .NET code and not your javascript.
I know this is an old post, but I thought I would shed some light on this issue in case anyone comes across this post. The error "Word s" NotSupportedException is referring to the property name "s" in the data that is being sent in JQuery's AJAX Method. This property must match the parameter name in the AjaxMethod on the server side. Therefore the correct data parameter to pass in the JQuery AJAX Method is
data: {lineNumber: btnID}
Sign in to post your reply or Sign up for a free account.
Similar topics
by: 20002937 |
last post by:
Hi All,
I am using AjaxPro dll in my ASP.Net application. Here, I
found that all the objects of the classes in the AjaxPro namespace are
not released. They are alive in all the pages.I found this...
|
by: DuaneMoraes |
last post by:
A new book on jQuery, the powerful JavaScript library, has been announced by Packt In Learning jQuery, Karl Swedberg and Jonathan Chaffer, creators of the popular jQuery learning resource...
|
by: mikeh3275 |
last post by:
I'm new to developing in jQuery, so I'm probably doing this wrong. I'm loading a form into a modal dialog box and I'm trying to assign a click event to the button in the form, but I can't seem to...
|
by: Aaron Gray |
last post by:
There does not seem too be anyway to test if two jQuery references are the
same element.
Given :-
... <div id="1"></div ....
Then :-
alert( $("#1") == $("#1"))
|
by: RobG |
last post by:
Do some of the regulars here need to re-think their (sometimes
strident) opposition to libraries? Both Microsoft and Nokia have
announced support for jQuery.
It seems to have gained quite a bit...
|
by: souporpower |
last post by:
Hi All
I am trying to print some HTML using JQUERY. I am posting the code. I
don't
see the alert. It seems as though the function is not registered when
the
document is loaded. Can someone...
|
by: souporpower |
last post by:
Hello All
I am trying to activate a link using Jquery. Here is my code;
<html>
<head>
<script type="text/javascript" src="../../resources/js/
jquery-1.2.6.js"</script>
<script...
|
by: jrod11 |
last post by:
hi,
I found a jquery html table sorting code i have implemented. I am trying to figure out how to edit how many colums there are, but every time i remove code that I think controls how many colums...
|
by: DolphinDB |
last post by:
Tired of spending countless mintues downsampling your data? Look no further!
In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM).
In this month's session, we are pleased to welcome back...
|
by: jfyes |
last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
by: PapaRatzi |
last post by:
Hello,
I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: Defcon1945 |
last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
| |