.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
MarieAdela
Imran Ghani
Post New Web Links

when should i use pagemethods?

Posted By:      Posted Date: September 19, 2010    Points: 0   Category :ASP.Net
 

Hello. i  wonder this. when should i use pagemethods? i try to develop an online ticket selling site. i try making admin panel proceses with pagemethod. In Everywhere in site,i try to use pagemthods. Is this approach  true?




View Complete Post


More Related Resource Links

customErrors and PageMethods.

  
Hi, I am working on a project to add PageMethods to an existing webapplication.Everything works just fine, up until the point where I need to catch the exception that is thrown in the code behind and show it on the page.I did some research and discovered that you need to turn customErrors off in order to receive the error on the client side.The problem is that I can't do this, because I can't convert the whole webapplication to use PageMethods in one time. So if I turn the customErrors off and an error occurs on another page, the system won't redirect the user to the errorpage.So my question is: Is there a way to turn the customErrors off only for PageMethods (or Ajax requests)?

pagemethods

  
HI ALL,loop is not working. loop continuesly run only one time calling this  OnComplete1why this ? and how to call 5 times.this is my code.var Valid = function () {            document.getElementById("<%=btnContactsMerge.ClientID%>").disabled = false;            PageMethods.sTotCount(OnComplete3, OnTimeOut3, OnError3);            return false;        }        var totCount = 0;        function OnComplete3(result) {            totCount = result;            for (var i = 0; i < totCount; i+=5) {                PageMethods.sMerge(OnComplete1, OnTimeOut1, OnError1);            }        }function OnComplete1(result) {            var lstAin = new Array();            lstAin = result;.............PageMethods.contactMerge(

Calling a Server side function from Javascript without using PageMethods

  
Good Day alli have used PageMethods to access the server side functions in javascript , but now my problem is that with pagemethods your controls will not go throught the full page lifecyle and these leads me to have "Object not set for an instance of an object" error. Now can someone come with a differnt approach without using pagemethods. What i want is to call a server side function , i dont want to pass any parameters to itthanks

Getting error when using PageMethods in DD

  

I having error when using PageMethods to call my method in code behind.

i getting error: Microsoft JScript runtime error: 'PageMethods' is undefined

Anyone have some idea on it?

Please advice.

Thanks.

 

 


ASP.NET PageMethods - Back Button Causing 'Authentication Required' Prompt

  

Since last week I've had a really odd issue with PageMethods and the back button which i've never seen before.

Essentially, I have a 'home page' which on document.ready (using jQuery), loads some data through PageMethods, and then renders a list - from which you can click through to a details page about  the item. In general use, it works fine. However, using the back button after clicking through (ie: going back to the home page), it throws a PageMethods error. The browser's 'authentication required' prompt appears, and if you click cancel, the server returns a 404. The error returned by PageMethods on the client side is 'authentication failed'.

Just FYI, the application is using ASP.NET forms authentication. The weird thing is, this happens as soon as you click the link and click back. It's not like the authentication cookie has expired or anything, and if you click cancel when the prompt appears and refresh the page, it works fine. I just can't work out what is going on.

I've tried disabling caching on the page [as I thought it was something to down with some browsers' caches of the DOM), but the same thing happens.

One workaround i've had is to redirect the page to itself if the PageMethods error is 'authentication failed', which does work - but only when you cancel the authentic

Can not call two different pagemethods with two service methods??

  

I am using an AJAX dropdownlist control with two dropdownlist.  Instead of using a webservice to populate the data, I used the pagemethod to populate.  My problem is the second droplist won't populate.  I get a server error, 500 in the droplist.  The first droplist populates fine.

BUT here's the real kicker.  If I reverse the order of the public static function such that GetHelloList2 comes BEFORE GetHelloList1 in the code, then the GetHelloList2 works ...... it just seems like it is only firing one pagemethod event and allowign only one.


Here's my code:

ASPX

<asp:DropDownList ID="DropDownList1"
  runat="server" Width="285px" />
<br />Second droplist<asp:DropDownList ID="DropDownList2"
  runat="server" Width="285px" />
<br />


<cc1:CascadingDropDown ID="CascadingDropDown1"
  runat="server" Category="Hello3"
  TargetControlID="DropDownList1" ServiceMethod="GetHelloListPageMethod"
  LoadingText="Please wait" PromptText="Select a model">
</cc1:CascadingDropDown>

             <c

Pagemethods

  

My page expects a customer ID. Let's say that ID is an integer.

Here is how a URL to call such a page would look like: http://myserver/Customer.aspx?CustID=12
 

 

I using Pagemethods in my page, but it direct to http://myserver/Customer.aspx without concate my CustID.

 

Please advice.. Thanks


ASP.NET PageMethods - Forms Authentication Cookie Not Always Sent

  

Since last week I've had a really odd issue with PageMethods, the forms authentication cookie, and the back button which i've never seen before.

Essentially, I have a 'home page' which on document.ready (using jQuery), loads some data through PageMethods, and then renders a list - from which you can click through to a details page about  the item. In general use, it works fine. However, using the back button after clicking through (ie: going back to the home page), it throws a PageMethods error. The browser's 'authentication required' prompt appears, and if you click cancel, the server returns a 401. The error returned by PageMethods on the client side is 'authentication failed'.

After inspecting the request in Fiddler, the forms authentication cookie isn't sent with the request, which would explain why it is happening. My fiddler entry for the request looks like this:

Cookies/Login
- ASP.NET_SessionId=XXXXXXXXXXXXXXXXX

The weird thing is, this happens as soon as you click the link and click back. It's not like the authentication cookie has expired or anything, and if you click cancel when the prompt appears and refresh the page, it works fine (and the cookie is sent). I just can't work out what is going on.

When it works, my Fiddler entry looks like this

Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend