AJAX :: PageMethod Not Working With IIS6
Jun 16, 2015My website is running fine on my local system but when i upload it on IIS6 of my local computer [Ajax.AjaxMethod] is not working. How i will solve it.
View 1 RepliesMy website is running fine on my local system but when i upload it on IIS6 of my local computer [Ajax.AjaxMethod] is not working. How i will solve it.
View 1 RepliesI'm running a weird issue here. I have code that makes jquery ajax calls to a web service and dynamically adds controls using jquery. Everything works fine on my dev machine running IIS 5.1, but not when deployed to IIS 6. I'm using VS2010/ASP.Net 4.0, C#, jQuery 1.4.2 and jQuery UI 1.8.1. I'm using the same browser for each.
It partially works though. The code will add the controls to the page, but they aren't visible until I click them (they aren't visible though). I thought this was a css issue, but the styles are there too.
The ajax calls look like this:
[code]...
After checking everything in Fiddler and finding no differences, I tried it in Firefox, where it worked. Got me to thinking and sure enough, I was wrong, IE WAS going into compatibility mode. apparently by default it will use compatibility mode on the intranet, but not localhost (which happened to be the different versions of IIS). I tried IE7 and got the same thing. I need to change my code to make sure it works on IE7 as well.
I have register.aspx at root level folder and updateprofile.aspx in folder /secure/user/ .
pagemethods are working good at root level folder aspx pages only.
pagemethod calling webmethod in updateprofile.aspx is not working. Getting "undefined" exception.
Why is this so?
My Pagemethod implementation is not working in Chrome browser. I have ASP.NET 3.5 web application developed in VS 2008.
The code below not working in chrome or Safari:
function FetchDataOnTabChange(ucName)
{
PageMethods.FetchData(ucName, OnSuccessFetchDataOnTabChange, OnErrorFetchDataOnTabChange);
}
function OnErrorFetchDataOnTabChange(error)
{
//Do something
}
function OnSuccessFetchDataOnTabChange(result)
{
//Do something
}
can any one tell me why url rewriting not working in iis6?
View 1 RepliesWe are migrating an existing asp.net application from Windows Server 2003 with IIS6 to windows server 2008 with IIS7.
we use System.Net.CredentialCache.DefaultCredentials to pass the user credential to a web service. It is working fine with the old environment but with the new one we got "The request failed with HTTP status 401: Unauthorized." error.
How can I fix this problem with IIS7?
I have a simple aspx file with 2 text boxes and an ajax autocomplete extender attached to textbox2
[code]....
This not working.. How can i make it work?
I have a long running process that i kick off with a pagemethod that normally takes about an hour to complete, when it is finished it returns the result of the method.I then poll with another pagemethod to update the status of the first process.the process is taking 4.5 hours this week which is acceptable and understandable, but the feedback sometimes gives up after a couple of hours and sometimes the main method never returns any feedback to the client.
Regardless of the lack of status updates and final feedback the server still completes the long task.As far as i'm aware we have made no changes to any timeout values.is there a timeout setting that we are hitting that is above 1 hour for ajax methods?
i am using Intelligencia.UrlRewriter on my website and it works fine on my development machine, i tryed to deploy on IIS6 and i get this error:
The page cannot be found
The page you are looking for might have been removed, had its name changed, or is temporarily unavailable.Please try the following: Make sure that the Web site address displayed in the address bar of your browser is spelled and formatted correctly. If you reached this page by clicking a link, contact the Web site administrator to alert them that the link is incorrectly formatted. Click the Back button to try another link. HTTP Error 404 - File or directory not found.
Internet Information Services (IIS)
Technical Information (for support personnel)
Go to Microsoft Product Support Services and perform a title search for the words HTTP and 404. Open IIS Help, which is accessible in IIS Manager (inetmgr), and search for topics titled Web Site Setup, Common Administrative Tasks, and About Custom Error Messages. this is the url that throws the error. [URL] this is the working url that is being rewriten to the above one. [URL]
I am using an AJAX.Net to call an ASP.Net PageMethod, which returns JSON serialized JSON data
{"d":"[{"Fromaddress":"testfrom1@test.com","Toaddress":"testto1@test.com"},{"Fromaddress":"testfrom2@test.com","Toaddress":"testto2@test.com"}]"}
The Response Header states the content type as
"Content-Type application/json; charset=utf-8"
However, the data is just available as a string, and does not seem to be available as JSON data from javascript. What do I need to do to work with the returned data as JSON from javascript?
I have a PageMethod that works perfectly well when it either (a) running in the VS dev server, or (b) deployed but marked with UseHttpGet=false.
What doesn't work, and is driving me mad, is having UseHttpGet=true and then deploying it to a test server (Vista & IIS7). It fails to call through the proxy with error code 404 coming back. But it works find if I set UseHttpGet=false.
I have gone through all of the basic stuff I can think to check, and as noted it works perfectly well on the dev box. So there must be something particular about full-blown IIS7 and its config that I am missing..
anything to check in the IIS manager that would cause this to fail? I've tried with forms authentication enabled and disabled, as a few posts mentioned issues with that.
I have a page that requires user login via Forms Authentication. Is it possible to use Page Methods in this page? My current attempt is resulting in the following error:Message: Sys.Net.WebServiceFailedException: The server method 'GetPlanContent' failed with the following error: System.InvalidOperationException-- Authentication failed.
View 2 RepliesI put my ScriptManger on the top level Masterpage with EnablePageMethods set to "true".2. I put a AutoCompleteExtender (AjaxToolkit) on a second level Masterpage which derives from the top level MasterPage. The AutoCompleteExtender is used for search with a TextBox. The PageMethod is defined in the Code Behind of this second level Masterpage.3. I have several Contentpages that derive from the second level Masterpage.Problem: The AutoCompleteExtender does not work and that's probably because the PageMethod is defined in the second level MasterPage in the CodeBehind and not in the Contentpage. Ok, so I'm pretty sure what causes the error,- I do not want to use a WebService, because I don't want the search to become public. And as far as I know you can't define a WebService that is only visible to the Website itself - it's always public.- It would be stupid to put the search on every Contentpage just for the PageMethods sake.
View 1 RepliesI have written an application that relies upon PageMethods. It was working fine in .NET 3.5 where I would rely upon exceptions to signify something failing during the call. I would then alert the user to what ever it was that happened. All was working great. I transitioned to .NET 4.0 as I am intrigued by the Parallel Computing improvements. Now any exception that I throw in the PageMethod in the code behind is met with an Unhandled Exception. Nothing has changed other than the target framework.
View 5 RepliesWe have used the ajax toolkit auto complete extender in an intranet app which uses Windows authentication. The auto complete uses a static page method in the page code behind to get the results. Even though the page containing the auto complete is authenticated by the server and the asp.net session id set in the cookie, the initial requests from the auto complete result in 401.1 and after few attempts result in a 200. This irritates the users of the app. Also later on there are 401.1 happening intermittently among the various 200 there by affecting the responses.
I have verified these responses by using Microsoft Network Monitor,Fiddler and Firebug. Also these entries are present in IIS logs. I tried to implement the same with a script service but that too gives same issues. Our site has lots of ajax features and controls and everything is working fine, only this issue is there.
<asp:ScriptManager ID="smHome" runat="server" EnablePageMethods="true" AsyncPostBackTimeout="600"> </asp:ScriptManager>
<CustomControls:StyledAutoCompleteExtender runat="server" ID="acAssociateSmartSearch"
TargetControlID="txtSmartSrch" ServiceMethod="GetAssociateSmartSearchList" MinimumPrefixLength="2"
CompletionListCssClass="sscompletionListElement" CompletionListItemCssClass="sslistItem"
CompletionListHighlightedItemCssClass="sshighlightedListItem" CompletionSetCount="10"
CompletionInterval="500" EnableCaching="true">
I have a master page/content page going on in this situation. The page has two page methods that work, and they feed info to a pair of autocomplete extenders. The script manager on the Master Page has 'EnablePageMethods' set to true. The content page has a ScriptManagerProxy. The strange thing is that I have used this pattern on four other pages within the project.
<System.Web.Services.WebMethod()> _
Public Shared Function testing(ByVal uid As String, ByVal issn As String, ByVal journalName As String) As String
Return "true"
End Function
Here is the javaScript code:
function AddJournal(uid, issn, journalName) {
alert("uid: " + uid + " issn: " + issn + " name: " + journalName);
PageMethods.testing(uid, issn, journalName,
function(res) {
if (res !== "true") {
alert(res);
} else {
alert("The journal " + name + ", issn as " + issn + " was successfully entered.");
}
return;
},
function(res) {
alert("The journal database could not be accessed
" + res.get_message() + "
Status Code: " + res.get_statusCode() + "
Exception Type: " + res.get_exceptionType() + "
Please try again.");
});
}
The fail function is executed, and the status code is 0 (zero), and the exception type is an empty string. I can change the function with no parameters, and I get same error. I can the leave the parameters at three on the VB side, and change the parameters to two on the client side; then I do not get the error message, but none the other alerts are executed.
I have a long running PageMethod defined in the cs that is being called from javascript and after 4 minutes I am getting the below error and 504 status code for my aspx page and onFail callback is raised.
<HTML><HEAD>
<TITLE>Gateway Timeout - In read </TITLE>
</HEAD><BODY> [code].....
need to send a byte array from javascript into a c# page method. The int and string variables work fine, but when I step through the c# code, the "object" which was the byte array is null, even though I checked to see if it had a value in JS.
var byteArrayObj = GetBinaryDataFromFile(filePath);
var tranAttachmentName = filePath.replace(/^.*\/, '');
PageMethods.AddFileToTran(tranId, tranAttachmentName, byteArrayObj, RefreshPage, onTimeout, onError);
[code]...
Is it mandatory to pass the Success and Failure method names as parameters while calling server side methods using PageMethods in client script.
I referred to article [URL] ....
This is a really odd situation, so hopefully I can explain it well enough.
I am deploying an ASP.NET 4 webforms application to a Windows Server 2003 SP2 server running IIS6.
Here's the problem -- when the application pool recycles its worker process (w3wp.exe), about 80% of the time, I will get an ReflectionTypeLoadException error trying to access any page in the app that contains an EntityDataSoure every time I try to view it.
However (this is the interesting part) -- the other 20%, it works just fine. I've actually resorted to turning off recycling the worker process entirely for this application pool and just add/remove whitespace from web.config forcing the site to recompile until I get a "good" w3wp.exe.
If this isn't clear, what I'm saying is: the actual worker process doesn't work at all for pages containing an EntityDataSource for about 4/5 times it starts, but still manages to serve all other pages just fine. Once you get a worker process that manages to serve a page with an EntityDataSource, it works every time until that process gets recycled.
My question is, how can I debug this? It works fine on my dev machine, it works fine on the server as long as you get a good process running, but iisreset or a server restart or anything that kills the worker process is almost guaranteed to cause the site to not come back up and throw this ReflectionTypeLoadException.
[Code].....
I have implemented AJAX for calling server side function using client side function call i.e Calling server side function using javascript tag by using PageMethod in javascript.
I have few question regarding the same implementation.
[code]....
This FunctionName will be the name of server side function that a developer want to call.
I am using PageMethods to send a few parameters to a webmethod in my codebehind. The method runs a stored procedure and uses the results to build a string that I am returning from the method.
Everything works fine until I try to include too many records in my results..
Once the results I am trying to return hit about 70K, the pagemethod times out even though it is taking about 1 second to process the results.
Is there a buffer limit or limit on the size or results returned from a pagemethod and if so, where can this be set or changed?
Is there a setting in the web.config somewhere to handle pagemethod buffer size?
I have a problem with partial postback in FireFox in my index.aspx I have following code:
[Code]....
Finally my Partialview has following content:
[Code]....
This code is working fine when using IE or Google Chrome, but when using FireFox the code in my controller is never reached. I just can't figure out what I am missing
I am trying to call a PageMethod using jQuery like this:
[WebMethod]
public stataic string WebMethod(PostData data)
{
//DO WORK
return "a";
}
PostData class is as follows:
[Code]....
I need to set a couple of Session vars by calling a PageMethod using jQuery.
The client side js looks like this:
function setSession(Amount, Item_nr) {
//alert(Amount + " " + Item_nr);
var args = {
amount: Amount, item_nr: Item_nr
}
//alert(JSON.stringify(passingArguments));
$.ajax({
type: "POST",
url: "buycredit.aspx/SetSession",
data: JSON.stringify(args),
contentType: "application/json; charset=utf-8",
dataType: "json",
success: function () {
alert('Success.');
},
error: function () {
alert("Fail");
}
});
}
and the server side like this:
[System.Web.Services.WebMethod(EnableSession = true)]
public static void SetSession(int amount, int item_nr)
{
HttpContext.Current.Session["amount"] = amount;
HttpContext.Current.Session["item_nr"] = item_nr;
}
only, it seems that the Session vars are not set. When I try to Response.Write out the Session vars, I get nothing. I get no errors, and I can alert out the values passed from the onclick event, to the js function, so they are there.