pagemethods

PageMethods is not Defined in ASPX Page

♀尐吖头ヾ 提交于 2019-11-30 07:54:45
问题 I'm looking at some old code that I can only assume worked at one time. MyPage.aspx: function GetCompanyList(officeId) { var companyList = document.getElementById('<%= CompanyDropDown.ClientID %>'); if (companyList.length == 0) PageMethods.GetCompanyList(officeId, OnGetCompanyList); else EditCompany(); } And: <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" /> Code behind: [System.Web.Services.WebMethod()] [System.Web.Script.Services.ScriptMethod()] public

Datalist Delete Command Event implementation using Page Methods

╄→гoц情女王★ 提交于 2019-11-29 15:52:05
I have a DataList and Update Panel in my page. After implementation, I checked that the response is talking very long time after using Update panels... Here is the study material . I have a Delete Command event in Datalist and works find in the above mentioned case. I was trying to implement Delete Command using Page Methods. Any Idea how to do that? I basically want to find hidden controls in this event and have to delete the record in `database. Any help will be highly appreciated. Rest Services The full application can be downloaded from: http://sdrv.ms/LJJz1K This sample uses rest services

WebMethod not called (triggered) by PageMethod in Visual Studio 2013

痞子三分冷 提交于 2019-11-29 14:34:05
I have the following problem: The call from a WebMethod is not being done on a project created in Visual Studio 2013 (ASP.NET WebForms Application). If I create a project, for example, in Visual Studio 2008 and migrate to VS 2013 works correctly. The problem only occurs when I create a new project in Visual Studio 2013. There is no error message in the console. The WebMethod is just not being called. Nothing happens. I searched a lot but found nothing about it. ASPX code: <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="Default.aspx.vb" Inherits="TestePageMethods._Default" %> <

Calling asp.net page method from javascript not working

匆匆过客 提交于 2019-11-29 13:27:22
Hi I am calling a simple page method from javascript , here is my code at markup function OnCallSumComplete(result, userContext, methodName) { alert(result); } function OnCallSumError(error, userContext, methodName) { if (error !== null) { alert(error.get_message()); } } function test(){ var contextArray = ""; PageMethods.TestMethod("test parameter", OnCallSumComplete, OnCallSumError, contextArray); } <asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server" /> at cs [System.Web.Services.WebMethod] public static string TestMethod(string para) { return "Yes this is working"

PageMethods is not Defined in ASPX Page

心不动则不痛 提交于 2019-11-29 05:38:59
I'm looking at some old code that I can only assume worked at one time. MyPage.aspx: function GetCompanyList(officeId) { var companyList = document.getElementById('<%= CompanyDropDown.ClientID %>'); if (companyList.length == 0) PageMethods.GetCompanyList(officeId, OnGetCompanyList); else EditCompany(); } And: <asp:ScriptManager ID="ScriptManager1" runat="server" EnablePageMethods="true" /> Code behind: [System.Web.Services.WebMethod()] [System.Web.Script.Services.ScriptMethod()] public IEnumerable<CompanyMinimum> GetCompanyList(int officeId) { return ( from c in Repository.Query<Company>()

updatepanel vs page methods

感情迁移 提交于 2019-11-28 22:01:09
I use update panels all the time when i wanna to update specific part of my page but recently i face performance problems ( i mean it 's slow in rendering the intended control and sometimes it doesn't work and need multiple click to work !! so my question is : Is the page method could be considered as an efficient alternative to the update panel and do the ajax magic ? What are the other alternatives? please if possible a simple example to clarify how to replace the update panel using with page methods ? Jupaol I used to be like you some years ago, I used to use UpdatePanel to gain performance

How to get controls in static web method

寵の児 提交于 2019-11-28 14:36:08
I have a [WebMethod] and i want to assign values to a text box using the this code: [WebMethod] public static void MyMethod(string s) { //TextBox1.Text = s; //Here how can i access the textbx? } You can't. The whole point of [WebMethod] s is that they don't run the ASP.Net page lifecycle. This way, they're fast and parallelizable. Your controls don't exist. Instead, you should use Javascript (better) or an UpdatePanel (worse). in case of static method(ie, page method asynchronous call), whole page is not posted back..and hence there is no information on server about the page controls(textbox

PageMethod and URl Rewrite

落爺英雄遲暮 提交于 2019-11-28 11:44:26
I am having issue with my pagemethod + url rewrite. When using regular URL: http://myweb.com/mypages/abc.aspx call to the PageMethod works fine. But when i use a friendly URL : http://myweb.com/abc it does work. No error though. Any help would be much appreciated. Roger Saladrigas You can set the right path to the aspx file from javascript using the PageMethods.set_path method: <script type="text/javascript"> PageMethods.set_path("/mypages/abc.aspx"); </script> The answer is taken from the official asp.net forum: http://forums.asp.net/p/1599846/4066920.aspx#4066920 There is a slight typo in

Datalist Delete Command Event implementation using Page Methods

◇◆丶佛笑我妖孽 提交于 2019-11-28 09:23:05
问题 I have a DataList and Update Panel in my page. After implementation, I checked that the response is talking very long time after using Update panels... Here is the study material . I have a Delete Command event in Datalist and works find in the above mentioned case. I was trying to implement Delete Command using Page Methods. Any Idea how to do that? I basically want to find hidden controls in this event and have to delete the record in `database. Any help will be highly appreciated. 回答1:

WebMethod not called (triggered) by PageMethod in Visual Studio 2013

主宰稳场 提交于 2019-11-28 08:21:08
问题 I have the following problem: The call from a WebMethod is not being done on a project created in Visual Studio 2013 (ASP.NET WebForms Application). If I create a project, for example, in Visual Studio 2008 and migrate to VS 2013 works correctly. The problem only occurs when I create a new project in Visual Studio 2013. There is no error message in the console. The WebMethod is just not being called. Nothing happens. I searched a lot but found nothing about it. ASPX code: <%@ Page Language=