I have found ASP.Net PageMethods very handy and easy to use, but I have just started developing using MVC and am not sure how to use them?
What is the equivalent of PageMethods.MyFunction() in MVC where MyFunction is a Controller action?
I know I can use the Json function to return a value, but how do I call the action from the client...
I am using the AJAX Toolkit:
<ajaxToolkit:CascadingDropDown ID="CategoryDDL_C" runat="server" TargetControlID="CategoryDDL"
Category="Main" PromptText="Please select a category" LoadingText="[Loading...]"
ServiceMethod="MainDDL" />
And for the Service Method:
[WebMethod]
[System.Web.Script.Services.ScriptMet...
I have a multiview on my aspx page whose ActiveViewIndex I want to set using javascript.
for this I have used UpdatePanel inside which the MultiView control is placed.
I have enabled the EnablePageMethods="True" of the ScriptManager.
Whenever I am calling the Server Method I am getting "Object reference not set to an Instance of an Obje...
Is it possible to format how an object is returned as JSON from a PageMethod? ie. removing the first "d" element from the data, without writing the JSON from scratch.
From { "d": { "name": "bob", "email": "[email protected]" } }
To { "name": "bob", email: "[email protected]" }
...
Hi,
I am unable to implement PageMethods feature of the scriptmanager in a usercontrol, is a way in which this can be done?
...
I am using .Net Ajax PageMethods. I was hoping I could pass a javascript array into my method but I am getting the error: "Type 'System.Array' is not supported for deserialization of an array". Here is a simplified version of what I am doing:
Client Side Code:
function AddItemsToBatch()
{
var stuff = new Array();
stuff[0] = "one thin...
In a javascript file I'm calling an ASP.NET Ajax PageMethod (ASP.NET 3.5), correctly defined in the page class a static method using the WebMethod attribute. This works on my development machine, but on the production server the PageMethod object is undefined when my javascript function is called (clicking a button).
Some debugging info...
I know that I can call a page method with jquery using the following syntax
$.ajax({
type: "POST",
url: "Default.aspx/GetDate",
data: "{}",
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function(msg) {
// Replace the div's content with the page method's return.
$("#Result").text(msg.d);
...
jQuery 1.3.2, ASP.NET 2.0. Making an AJAX call to a PageMethod (WebMethod) returns the full/whole page instead of just the response. A breakpoint on the page method shows it's never getting hit. I have the [WebMethod] attribute on my method, and it is public static, returns string and accepts no params. I even tried adding [ScriptSer...
I am using asp.net ajax version 1.0 on asp.net 2.0. (I cannot yet upgrade to 3.5)
I had a PageMethod that would get called by Javascript. This worked perfectly until I added an UpdatePanel to another part of the page. Now when I run the page with debug turned on The breakpoint in the pagemethod never gets called. when I look in firebug ...
I am using ASP.Net Ajax's Page Methods and I have an issue that an enumeration's definition is not being rendered. Here is what I have:
public class Contact
{
public string FirstName{get;set;}
public IList<PhoneNumber> PhoneNumbers{get;set;}
}
public class PhoneNumber
{
public string Number{get;set;}
public PhoneNumberTyp...
I have a javascript call to a C# WebMethod. The same page has another call and it is working. I debugged the javascript code, this is called:
function userUpdReq_onOk()
{
...
var clientValidationPassed =Page_ClientValidate();
if( clientValidationPassed )
{
PageMethods.RequestUserUpdate(username, email, sex, zipCode, state, city, neighb...
ASP.NET 2.0, PageMethods.
Good day,
I'm using ASP.NET AJAX PageMethods to dynamically change the text of a Label when a dropdownlist is changed on my page.
I know that the text of Labels are not retained between postbacks when they are changed on client-side, which is my case. I've heard that a solution is to keep the label content in...
I am performing a jQuery .ajax() call that returns a List<string> of IP addresses on a specified subnet. I use a [WebMethod] on an .aspx page to return the values. ASP.NET's built-in JSON serializer does the magic to return the actual JSON used in my Javascript.
I have profiled the the server-side time, and it takes about 8 msec to po...
Our team is trying to figure out some guidelines for using pagemethods vs. creating an actual asmx web service. Seems to me that pagemethods are primarily for one off type calls that are specific to the page, where as asmx are intended are intended represents more of a reusable set of operations and services. Does this sound correct?
...
I have a following scenario – and what I am really looking is real help from real people. Suggestions / Solutions ? Please.
I have an extranet web site for ex. www.foo.com (asp.net 3.5)
I am using JQuery 1.3.2 to call ValidateLogin PageMethods in default.aspx page ( www.foo.com/default.aspx)
The code will look like this
$.ajax({
...
Here's the situation: I would like to iterate through a table with input controls, collect up the values and then submit them to an ASP.Net PageMethod to save the data to the database. I have the collection all figured out, but am getting an error that the string can't be converted to a Dictionary.
So I end up with something like this b...
I can't figure out why the exception from a static ASP.Net Page method isn't bubbling up to the Application_Error event to be handled in the global.asax file. I'm not really expecting any errors, but I would like to be safe and know about them if they do happen to occur and would rather not wrap every static method in a try...catch.
Doe...
Simply put I want to call public static methods decorated with WebMethod attribute inside my code-behind C# file from jquery.ajax to get some json and other simple stuff (in different functions). But instead I'm getting whole page :'(
I'm not using asp.net AJAX though I'm developing for .NET 3.5 framework and using VS 2008. (There are s...
It's saying PageMethods is undefined.
...