pagemethods

Ajax PageMethods Vs XMLHTTP

Hi guys, i have a case where when the user closes the browser window i have to set an Application Object to null...and for this i will use the JavaScript onbeforeUnload to do the server side work... so i wanted to know which is better XMLHTTP or an ajax PageMethod...which is faster..?? i have used both and found that pagemethods requi...

why is this page method failing?

I have my script manager with attribute enablepagemethods set to true, however, for some reason this is alert me I've failed. public partial class _Default : System.Web.UI.Page { protected void Page_Load(object sender, EventArgs e) { } [WebMethod()] public static string test() { return "q343242342342";...

calling server side method in JQuery in asp.net

hi, in my application i have an form where user enter their username first . now i should check whether that username is avilable or not i have wtitten an method "username" which does this whuch return true or false as a return type. here i am doing using jQuery with ajax to achive this concept. once the u...

Add an Editor control dynamically inside of a repeater using AJAX

I'm looking for a way to add an Editor control (from the ASP.NET AJAX Control Toolkit) to each element of a repeater. It's working fine if I just include it in the ItemTemplate of the repeater, but my problem is that the markup it produces is massive, which slows down the page considerably (even with compression on). I haven't had any ...

ASP.Net Ajax - PageMethods Synchronous call and retrieval of results

How to ASP.Net Ajax - PageMethods Synchronous call and retrieval of results ? Currently i am doing following async call and working with data : function checkName(name) { PageMethods.IsAvailable(name, onSuccess); } function onSuccess(result, context, method) { //... do something with result .... } How can i do same synchro...

How to get Ajax.Net PageMethod to return JSON

I am using an AJAX.Net to call an ASP.Net PageMethod, which returns JSON serialized JSON data {"d":"[{\"Fromaddress\":\"[email protected]\",\"Toaddress\":\"[email protected]\"},{\"Fromaddress\":\"[email protected]\",\"Toaddress\":\"[email protected]\"}]"} The Response Header states the content type as "Content-Type application/jso...

Passing JSON to a PageMethod that expects a List<T> parameter

I have an ASP.NET PageMethod with the following signature: <WebMethod()> _ Public Shared Function SaveCodes(ByVal codes As List(Of Code)) As String I am trying to pass a JSON object to the PageMethod from the client side, but I get an error that the type String cannot be converted to type of List<Code>. Here is the json that I'm buil...

PageMethods exception details

I have quite a big project and it is all done using pagemethods. Code behind is basically just to serve and handle the data. Everything works perfect, except for one thing - I recently created a custom exception class that I want to use for more user friendly reports and even possible actions. For this purpose, I inherited the exception ...

System.diagnostics and System.Debug not working from Page Method

We have a Page Method on a web page using ASP .Net. We tried to put in a trace statement using both System.Diagnostics and System.Diagnostics.Debug. In Visual Studio 2008, the break point is not even hit for the line, but other break points on other lines are hit. There is no output from either method that we can see. There is also a G...

How to use jQuery to call ASP.NET AJAX Page Method?

How to use jQuery to call ASP.NET AJAX Page Method? ...

window.location change fails AJAX call

I've got a click tracking AJAX function (calls a WebMethod on an .aspx page), and I need to call it when the user clicks through to a link. Unfortunately, I'm using window.location = "newUrl" to change the page, which seems to make the AJAX call fail. Is there a way around this? I do not need to get any information back from the AJAX c...

Javascript JSON.stringify object containing arrays serialization problem

I javascript I have an object that looks similar to: var myObj = { prop1: 1, prop2: 2, prop3: ["a","b","c","d","e"], prop4: 4, prop5: ["f","g","h","i"] } It's an object containing a number of properties. Each property may or may not be an array. var serializedMyObj = JSON.stringify(myObj); serializedMyObj is (fou...

Executing only the last function called

Hello! This is the setup in short. I have a big table. Everytime a cell get focus an asyncron call to the server is done (with PageMethods) and some data is returned and updates a infobox in the page. I have written code that makes it possible to navigate between cells with the arrow keyes. The problem occurs when I shift focus fast t...

Sending a complex object as parameter to Asp.Net PageMethod

I am trying to send an object created in JavaScript to an ASP.NET PageMethod. This object mirrors the properties of an existing custom business object, so i was hoping that i could pass a single object instead of a parameter for each property. I am getting an error "Unknown web method SavePart when attempting to use this method. Javasc...

Can an ASP.NET user control determine its context or its parent .aspx file

Is it possible for a user control to determine its "context" or its parent .aspx page in some way? Right now I have a user control that is declared on a typical .aspx page as follows: <%@ Register TagPrefix="uc1" TagName="ManageTitle" Src="../UserControls/ManageTitle.ascx" %> The user control currently emits a textbox as follows: <a...

Read out result of a PageMethod into a jQuery-script

Hello, I am quite a jQuery novice and try to read out the result of a PageMethod into my jQuery script. I have a ScriptManager installed and the following WebMethod: [WebMethod(EnableSession = true)] public static string CheckSystemDefault(string _id) { int id = Convert.ToInt16(_id); addressTypeRepository = new A...

How secure is my ASP.NET code?

Hello all, I've developing an ASP.NET application that interfaces with Google Maps and retrieves marker information from a database. The marker information is split into tables in the database, where the name of the table reflects a company (e.g. CompanyA_MarkerData, CompanyB_MarkerData etc). In order to periodically update the map with...

PageMethods security

Hi, I'm trying to 'AJAX-ify' my site in order to improve the UI experience. In terms of performance, I'm also trying to get rid of the UpdatePanel. I've come across a great article over at Encosia showing a way of posting using PageMethods. My question is, how secure are page methods in a production environment? Being public, can anyon...

How to pass int values to asp.net page methods from jquery?

I am using asp.net page methods with jquery..... Here is my code, $.ajax({ type: "POST", url: "Default.aspx/GetRecords", data: "{}", contentType: "application/json; charset=utf-8", dataType: "json", and asp.net page method is, [WebMethod] public static string GetRecords(int currentPage,int pagesize) { ...

How to call an ASP.NET WebMethod using PowerShell?

It seems like ASP.NET WebMethods are not "web servicey" enough to work with New-WebServiceProxy. Or maybe it is, and I haven't figured out how to initialize it? So instead, I tried doing it manually, like so: $wc = new-object System.Net.WebClient $wc.Credentials = [System.Net.CredentialCache]::DefaultCredentials $url = "http://www.dom...