Hello,
I want to pass Custom Class Object in Web method(on my code behind) in asp.net using javascript on click of img tag(which is in dynamically created div) .But i am getting problem in it. and getting following error:
"Invalid web service call, missing value for parameter: 'ord'."
Here is my Code:
@"<div class=slctd_prod><div><span class=extra_info><img alt='img not found' src='Theme/img/CancelOrder1.jpg' id='Img2' onclick='GetMessage(" + currOrder + @" );return false;'/></span></div>
in above code "CurrOrder" is my custom class object. which is having multiple properties.
and My javascript function look like this:
<script type=text/javascript>;
function GetMessage(abc) {
PageMethods.Message(abc,OnGetMessageSuccess, OnGetMessageFailure);
}
function OnGetMessageSuccess(result,userContext, methodName) {
alert(result);
}
function OnGetMessageFailure(error, userContext, methodName) {
alert(error.get_message());
}
and My code behind function in .aspx.cs file is look like this:
public static void Message(cOrder ord)
{
}
and please do not suggest me to use Jquery or JSON for this. because i don't want these things.
Please any one can help me!
Thanks in Advance.