Showing posts with label error. Show all posts
Showing posts with label error. Show all posts

Wednesday, March 28, 2012

Page_Validator undefined Error??

Hi,

I have a jscript function calledEnableAll(). The following is the Function:-

function EnableAll()

{

alert("Hai");

EnableAllValidators(false);

EnableValidator('valreq_Salutation',true);

ShowError();

}

This i called on a button click. but only the alert message is pop_up. after that im getting this errorPage_Validators is undefined Jscript runtime error .

What was the solution for this??

How can i over come this...

Hi,

I'm not quite sure why you use this function. It seems you want to enable all validators on the page according to the name of the function.

The error is caused by an javascript exception, looks like it uses an object that doesn't exist internally. And I can't tell since I don't know your implementation in EnableAllValidators and EnableValidator function. You'd better use Visual Studio to debug your javascript to find out the reason and resolve it.

PageMethods

Hi Folks

I'm getting an error with AJAX Beta1 trying to access PageMethods...

function beginImport() { disableButton('btnSubmit'); displayProgress(); updateText('Importing Translations, please wait for process to complete before clicking anything!'); PageMethods.Import(onImportComplete); }

Causes this error...

Error: PageMethods is undefined

Are you defining the onImportComplete function in Jscript?

I have the same problem. I keep getting "PageMethods is not defined" error. Here's my code:

<%@. Page Language="C#" AutoEventWireup="true" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"><title>Untitled</title><script runat="server"> [System.Web.Services.WebMethod] public string GetMessage() { return "Hello World"; }</script></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <a href="#" onclick="javascript:preview();">Test</a> <script type="text/javascript" language="javascript"> function preview() { PageMethods.GetMessage(onComplete); } function onComplete(res) { alert(res); } </script> </form></body></html>

Shawn Burke talks about PageMethods and Ajax Beta in hisblog

It seems that they need to be static and marked with the ScriptMethod attribute. But if PageMethods are static how do we access page control values within such a method?


I am completely stuck on the pagemethods, and having the same problem. I have read the blog and added the [ScriptMethod] tag to the page method (this tag is not in Microsoft's pagemethod tutorial (here), but I am willing to try anything at this point). I have used the default web.config file that is created when you use the ASP.NET AJAX CTP - Enabled Website template in VS2005, and verified that all of the settings are present as outlined in the migration white paper and the webservice tutorial on ajax.asp.net.

I need to be able to call a pagemethod because i need access to the viewstate and server control properties on the page. A webservice would not give these to me.

All of this worked fine in the July CTP... here is my code:

[C#]

[WebMethod]
[Microsoft.Web.Script.Services.ScriptMethod]
publicstatic GeneralLiability.GeneralLiabilityQuote GetQuote()
{
returnnew GeneralLiability.GeneralLiabilityQuote(10);
}

[JS]

Rate:function()
{
this.showLoadingPanel();
this._MustRefresh.set_visible(false);
// should be page method
PageMethods.GetQuote(this.onGetQuoteComplete, this.onGetQuoteTimeOut);
},

[ScriptManager]

<asp:ScriptManagerID="ScriptManager1"ScriptMode="Debug"runat="server">
<Scripts>
<asp:ScriptReferenceAssembly="Microsoft.Web.Preview"Name="Microsoft.Web.Resources.ScriptLibrary.PreviewScript.js"/>
<asp:ScriptReferenceAssembly="Microsoft.Web.Preview"Name="Microsoft.Web.Resources.ScriptLibrary.PreviewGlitz.js"/>
<asp:ScriptReferenceAssembly="Microsoft.Web.Preview"Name="Microsoft.Web.Resources.ScriptLibrary.PreviewDragDrop.js"/>
</Scripts>
<Services>
// ths webservice is a work around until i get the PageMethod working
<asp:ServiceReferencePath="~/WebServices/RateWebService.asmx"/>
</Services>
</asp:ScriptManager>


Spent alittle more time looking at the PageMethods issue.

I wrote a small test app and realized that the PageMethods object exists when the webmethod is included in the aspx file (as long as I added the
[Microsoft.Web.Script.Services.ScriptMethod]) attribute, but when I move it to the code-behind file, it gives me the undefined error... which leads me to question... are pagemethods no longer allowed in the code-behind file?

Anyone?


See:http://blogs.msdn.com/sburke/archive/2006/10/21/hint-components-that-use-web-services-with-asp-net-ajax-v1-0-beta.aspx. PageMethods are broken in Beta1 and do not work in code behind.

Dimitrod, you say: "But if PageMethods are static how do we access page control values within such a method?".
I may be wrong, but IMO it does not make sense to access controls in PageMethods. PageMethods are part of the business layer. You should read control values using client-side code, pass these values to the method as parameters and read the returned data in the form of a basic type or a complex serialized object. I personally think it is a good thing that PageMethods are now static.


In the Atlas July CTP, Im using the Page.User.Identity.Name as a security verification inside the PageMethods , How would I do this in the new version without passing parameters in javascript, as this would reveal the values.

>> I may be wrong, but IMO it does not make sense to access controls in PageMethods. PageMethods are part of the business layer.

Yes and no. But the point is you can already achieve teh 'business layer' effect by calling a Web Service and now with PageMethods being forced to be static you're doing nothing but duplicating that functionality. All this does give you another place to store your 'service methods'.

Allowing access to the page is very valuable IMHO because it allows you to read values set on the client without having to pass every damn field value as a parameter or as part of an object you first populate on the client.

Consider this: You have a form with 50 input fields on it and the user fills that out. Now you want to use AJAX to save those values. If you use PageMethods or Web Service you have to pass 50 parameters or create a client object that first parses the values out of the fields, possibly converts to the proper types etc. Then you send the data to the server, and you get the parse the values AGAIN on the server - out of the parameters or object into a business object or a DataRow or whatever.

Instead not passing parameters but receiving the values from the client directly on the server in the POST buffer lets you deal with the input values once and store it directly into your object.

I can be a huge timesaver and reduces boatloads of error prone $get() statements on the client.

If all that PageMethods does is duplicate Web/SCript Service behavior but in a page I say cut the whole thing and take the overhead out of the Page class.


Page.User is merely a convenience property that wrapsSystem.Threading.Thread.CurrentPrincipal, which is static, so just access that instead :)


Rick,

Convincing point of view, although a form with 50 input fields seems theoretical to me because it is not very user friendly. I should not have said "it does not makes sense" but I still do not like it.

Despite the fact that you definitely have a point, I prefer the more stateless approach of parsing the fields on the client and feeding a Javascript object that is passed to the web service or page method as you describe. Contrary to what you say, it is not needed to parse the object again on the server, the ASP.NET Ajax layer does that automatically for you, although you may have to write a couple of converters. Note that my business objects are very light data structures which are effectively persisted by business brokers.

By the way, thank you for your valuable web site, which I often consult.


I agree as well - in most cases I use Web Services to abstract the logic, because it's just cleaner. But I would very much like to have the option to be able to get at the data in an easier way in the page.

As to the form with 50 fields: Well there's lots of ways to represent data <s>. Yeah you're probably right but I have a couple of forms that have this much data in various pages of a tabbed interface that's driven through AJAX. In fact in a properly architected AJAX application values are probably updated more frequently than one giant form submit.

But even so even if you have a smallish form like this:

http://www.west-wind.com/atlas/CustomerList/AtlasCustomerList.aspx

You then have code like this to retrieve the data to send to the server:

// *** Cheating: This object contains only strings!
// If other types exist conversion
// must be done here.
Customer.Companyname = GetValue('txtCompany');
Customer.Contactname = GetValue('txtContactName');
Customer.Address = GetValue('txtAddress');
Customer.City = GetValue('txtCity');
Customer.Postalcode = GetValue('txtPostalCode');
Customer.Region = GetValue('txtRegion');
Customer.Country = GetValue('txtCountry');

// *** Pass back the customer object to the server
CustomerService.SaveCustomer(Customer,SaveCustomerCallback,ErrorCallback,ErrorCallback);

It gets worse if the object your setting values on has typed values - then you have to do type conversion in JavaScript which is no fun... Then on the server you do that parsing again out of the object so you're just duplicating the work.

When I meant 'parsing on the server' I didn't mean parse the object. You do get the object back on teh server. But it's a proxy at best and from there you have to move the data out into a real object that actually does the data logic - an Entity that can save or a DataRow or whatever it may be. For most types a type converter isn't even required as the JSON proxy creates the required proxy objects on the client for you. That is very cool, but it's still more work than it has to be - you're still 'reading' the data twice - once on the client, then again on the server. Instead you could do it once and be done with it.


As something of an ASP.NET AJAX Novice I find this thread very interesting.

For me it touches a wider issue which is that for the newbie there is a vast array of possible approaches to building an ASP.NET AJAX app and the best path is not always clear.

My very first app simply used an UpdatePanel and seemed to work fine but then I decided I wanted a bit more control over what was happening.

Consequently my next app used PageMethods to call functions in the ASP.NET Codebehind. Again this seemed to work fine for such things as retrieving Strings etc.

Then I looked at Web Services and devised a couple of those which I then referenced from my ASPX pages (using the ScriptManager)

Now though I'm not really very clear where to go next.

I guess it's like anything else, you just need to give it time and try lots of different things before you can make a judgement call on the best way forward. The danger is that for those of us who have never used much javascript, we may be tempted to try and avoid it (using the UpdatePanels etc) but then come unstuck when we want a bit more control over our app's behaviour.

I hope the documentation will help with this though once the framework goes RTM.


I think ScriptMethods (PageMethods) are part of the UI layer; consider where they are declared - no business logic should be residing in the Page class. I hope they change it so that they'll go back to being state-aware and part of the Page lifecycle again. The way it's implemented in the new beta, there's really not much distinction between a ScriptMethod and a WebMethod (web service) any more.

insted of breaking ypur head and program again and again

it is better to wait to next version or final version

i will stick in july ctp until a better version will come

my program need page.clientscript.registerStartupscript and PageMethod

and both of them not working in ajax beta 1

so why go ther from july ctp?

Monday, March 26, 2012

PageMethods is Undefined

HI,

its Urgent

I am Getting Same Error Could u please Help me Out..

Here is My Code..

using System.Web.UI.HtmlControls;

using System.Web.Services;

using Microsoft.Web.Script.Services;

using Microsoft.Web.Script;

[WebMethod]publicvoid GetNewMessage()

{

string str ="Hello";

Response.Write(str);

}

Javascript

PageMethods.GetNewMessage();

<asp:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true">

<Scripts>

<asp:ScriptReferencepath="scripts.js"/>

</Scripts>

</asp:ScriptManager>

Thanks in Advance,

Suman...

Please its Urgent...

this is not sufficient to debug your error ... you need to show us the whole thing ... and what kind of error is that? JavaScript or server error?


check this post out ... same error as yours:http://forums.asp.net/t/993893.aspx


ScriptManager has to have EnablePageMethods=true and the WebMethod has to be static.


hi here is my full code..

aspx file

<bodystyle="margin: 0px;padding: 0px;">

<formrunat="server"action="RF_Message.aspx">

<divid="ContentPanel">

<divid="MessageList">

<asp:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true"EnablePageMethods="true"EnableScriptGlobalization="true"EnableScriptLocalization="true">

<%--<Scripts>

<asp:ScriptReference Path="scripts.js" />

</Scripts>--%>

</asp:ScriptManager>

</div>

</div>

</form>

</body>

</html>

<scriptlanguage="javascript"type="text/javascript">

var str = PageMethods.GetNewMessage();

alert(str);

var result = document.createElement("div");var divlist = el("MessageList");

result.innerHTML = str;

divlist.appendChild(result);

function el(id)

{

return document.getElementById(id);

}

</script>

aspx.cs file..

using System;

using System.Data;

using System.Configuration;

using System.Collections;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using System.Web.Services;

using System.Web.Script.Services;

using System.Web.Script;

publicpartialclassRF_Message : System.Web.UI.Page

{

//ChatManger Chatmanger = ChatManger.GetChatManager();

protectedvoid Page_Load(object sender,EventArgs e)

{

}

}

#region Script callback function

[System.Web.Services.WebMethod]

publicstaticstring GetNewMessage()

{

string str ="Hello";

return str;

}

#endregion

}

I am Getting Javascript Error While Running...

i am Getting alert Undefined...


RIght, you're executing that embedded script block as the page gets to it; pagemethods haven't been created yet (that happens during the clientside init, iirc. Try pulling all that code into your pageLoad() javascript function and see if that doens't help.

PageMethods not found (Javascript Error)

Hey Guys,

the following is my aspx page

<%@dotnet.itags.org.PageLanguage="C#"AutoEventWireup="true"CodeFile="Default.aspx.cs"Inherits="_Default" %>

<!DOCTYPEhtmlPUBLIC"-//W3C//DTD XHTML 1.1//EN""http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">

<htmlxmlns="http://www.w3.org/1999/xhtml">

<headrunat="server">

<title>Untitled Page</title>

</head>

<body>

<formid="form1"runat="server">

<asp:ScriptManagerID="ScriptManager1"runat="server"EnablePageMethods="true"/>

<div>

<scripttype="text/javascript">

function getme()

{

PageMethods.getResults();

}

</script>

<asp:LabelID="lblText"runat="server"></asp:Label>

<inputtype="button"value="btnVal"onclick="getme();"/>

</div>

</form>

</body>

</html>

The following is my code behind

using System;

using System.Data;

using System.Configuration;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using System.Web.Services;

publicpartialclass_Default : System.Web.UI.Page

{

protectedvoid Page_Load(object sender,EventArgs e)

{

}

[WebMethod()]publicvoid getResults()

{

lblText.Text ="Sridhar";

}

}

The Current Version only support static method for Page Methods. So you cannot access the other element of the page.


Modify your page method return a string, then set lblText's value on the client side. This is an example of doing exactly that: http://encosia.com/index.php/2007/07/11/why-aspnet-ajax-updatepanels-are-dangerous/

PageRequestManagerParserError in IE6 and 7

Hi,

I've created a pretty simple custom control that filters items based on categories the user selects in a drop down box.
Here's the error I'mintermittently getting in IE6 and IE7 but not any mozilla-based browsers.

error

Because of it's intermittent nature it seems like something out of my control...
I've made sure there are no Response.Write(), Response Filters, HttpModules running and that server trace isn't enabled.

I've used Fiddler to look at the responses but can't find the offending part in the error message.

I've googled the error and found this:

http://forums.asp.net/p/1037846/1437627.aspx

I am using a VirtualPathProvider to map requests to items in a cms, but the article above deals with an incorrect formaction being returned in the httpmessage. I've checked the formaction being returned and it is correct.

I'm at a loss. This is a real pain because a lot of time has been invested in using Asp.Net Ajax for our new site and this may make us have to rethink that decision.

Here is the code for my custom control.

using System;

using System.Data;

using System.Configuration;

using System.Web;

using System.Web.Security;

using System.Web.UI;

using System.Web.UI.WebControls;

using System.Web.UI.WebControls.WebParts;

using System.Web.UI.HtmlControls;

using System.Collections;

using System.Collections.Generic;

using System.Text;

namespace Unwrong.Controls

{

publicclassFilterList :Control,INamingContainer

{

privatestring _Category;

privateList<FilterListItem> _Items =newList<FilterListItem>();

privateint _MaxVisibleItems;

privateint _Position = 0;

privatestring _CssClass;publicstring Category

{

get {return _Category; }

set { _Category =value; }

}

publicList<FilterListItem> Items

{

get {return _Items; }set { _Items =value; }

}

publicList<FilterListItem> ItemsInCategory

{

get {return GetItemsInCategory(); }

}

publicint MaxVisibleItems

{

get {return _MaxVisibleItems; }

set { _MaxVisibleItems =value; }

}

publicint Position

{

get {return _Position; }set { _Position =value; }

}

publicstring CssClass

{

get {return _CssClass; }

set { _CssClass =value; }

}

protectedoverridevoid OnInit(EventArgs e)

{

Page.RegisterRequiresControlState(this);base.OnInit(e);

}

protectedoverridevoid AddParsedSubObject(Object obj)

{

if (objis Unwrong.Controls.FilterListItem)

{

Items.Add((Unwrong.Controls.FilterListItem)obj);

}

}

protectedoverridevoid CreateChildControls()

{

System.Collections.IEnumerator myEnumerator = Items.GetEnumerator();

while (myEnumerator.MoveNext())

this.Controls.Add((FilterListItem)myEnumerator.Current);

}

protectedoverrideobject SaveControlState()

{

FilterListViewstate state =newFilterListViewstate();

state.Category = Category;

state.Position = Position;

return state;

}

protectedoverridevoid LoadControlState(object state)

{

if (state !=null)

{

Category = ((FilterListViewstate)state).Category;Position = ((FilterListViewstate)state).Position;

}

}

protectedoverridevoid Render(HtmlTextWriter w)

{

List<FilterListItem> itemsToDisplay = GetDisplayItems();w.Write(@dotnet.itags.org."<script language='javascript' type='text/javascript'>

<!--

function hide(id){

try{

var obj=$get(id);

obj.style.visibility='hidden';

}catch(e){}

}

function show(id){

try{

var obj=$get(id);

obj.style.visibility='visible';

}catch(e){}

}

//-->

</script>

");w.Write("<div class=\"column1\">");

w.Write(GetItemsInColumn(0));

w.Write("</div>");

w.Write("<div class=\"column2\">");

w.Write(GetItemsInColumn(2));

w.Write("</div>");w.Write("<div class=\"column3\">");

w.Write(GetItemsInColumn(4));

w.Write("</div>");

}

privatestring GetItemsInColumn(int index)

{

List<FilterListItem> items = GetDisplayItems();

// Check if any items are at the necessary indeces.

if (items.Count > index)

{

StringBuilder sbHtml =newStringBuilder();

// Create the html for two projects.

for (int i = 0; i < 2; i++)

{

index += i;

if (items.Count > index)

{

FilterListItem item = items[index];

sbHtml.Append("<div class=\"project\" ");

sbHtml.Append("onmouseover=\"this.style.backgroundColor='#E1E1E1'; hide('" + ClientID +"_title" + index +"'); show('" + ClientID +"_details" + index +"');\" ");

sbHtml.Append("onmouseout=\"this.style.backgroundColor='#FAFAFA'; show('" + ClientID +"_title" + index +"'); hide('" + ClientID +"_details" + index +"');\" ");

sbHtml.Append(">");if (!String.IsNullOrEmpty(item.ProjectLink))

{

sbHtml.Append("<a href=\"" + item.ProjectLink +"\"><img src=\"" + item.Image +"\" alt=\"" + item.Title +"\" title=\"" + item.Title +"\" /></a>");

}

elseif (!String.IsNullOrEmpty(item.LiveLink))

{

sbHtml.Append("<a href=\"" + item.LiveLink +"\" target=\"_blank\"><img src=\"" + item.Image +"\" alt=\"" + item.Title +"\" title=\"" + item.Title +"\" /></a>");

}

else

{

sbHtml.Append("<img src=\"" + item.Image +"\" alt=\"" + item.Title +"\" title=\"" + item.Title +"\" />");

}

sbHtml.Append("<div id=\"" + ClientID +"_title" + index +"\" class=\"title\">");

sbHtml.Append(item.Title);

sbHtml.Append("</div>");

sbHtml.Append("<div id=\"" + ClientID +"_details" + index +"\" class=\"details\">");

if (!String.IsNullOrEmpty(item.ProjectLink))

{

sbHtml.Append("<a href=\"" + item.ProjectLink +"\">View Details</a>");

}

else

{

sbHtml.Append("<span class=\"strikethrough\">View Details</span>");

}

if (!String.IsNullOrEmpty(item.LiveLink))

{

sbHtml.Append("<br/><a href=\"" + item.LiveLink +"\" target=\"_blank\">View Live</a>");

}

else

{

sbHtml.Append("<br/><span class=\"strikethrough\">View Live</span>");

}

sbHtml.Append("</div>");sbHtml.Append("</div>");

}

}

return sbHtml.ToString();

}

else

{

returnstring.Empty;

}

}

privateList<FilterListItem> GetItemsInCategory()

{

List<FilterListItem> itemsInCategory =newList<FilterListItem>();

// Remove all items that aren't in current category.

foreach (FilterListItem itemin Items)

{

if (IsItemInCategory(item))

{

itemsInCategory.Add(item);

}

}

return itemsInCategory;

}

privateList<FilterListItem> GetDisplayItems()

{

List<FilterListItem> itemsInCategory = GetItemsInCategory();

List<FilterListItem> itemsToDisplay =newList<FilterListItem>();

int count = MaxVisibleItems;if (Position + MaxVisibleItems > itemsInCategory.Count)

{

count = itemsInCategory.Count - Position;

}

return itemsInCategory.GetRange(Position, count);

}

privatebool IsItemInCategory(FilterListItem item)

{

if (String.IsNullOrEmpty(Category) || Category.ToLower() =="all")

{

returntrue;

}

foreach (string cin item.Categories)

{

if (c.ToLower().Trim() == Category.ToLower().Trim())

{

returntrue;

}

}

returnfalse;

}

}

[Serializable]

publicclassFilterListViewstate

{

publicstring Category;publicint Position;

}

}

Here is the code for page where it is used:

<asp:UpdatePanelID="UpdatePanel1"runat="server"UpdateMode="Conditional">

<ContentTemplate>

<tableid="filter-widget-bar"cellpadding="0"cellspacing="0"border="0">

<tr>

<tdclass="col1">

<imgsrc="/assets_new/images/projects.gif"alt="Projects"/>

</td>

<tdclass="col2">

<tableid="filter-widget"cellpadding="0"cellspacing="0"border="0">

<tr>

<td>

<ctrl:ImageButtonID="btnPreviousProject"runat="server"CssClass="previous"ImageUrl="~/assets_new/images/btn_previous.gif"OnClick="btnPreviousProject_Click"BorderWidth="0"AlternateText="Previous"/>

</td>

<td>

<asp:DropDownList

ID="lstFilter"

OnSelectedIndexChanged="lstFilter_OnSelectedIndexChanged"

AutoPostBack="true"

runat="server">

<asp:ListItem>Favourites</asp:ListItem>

<asp:ListItem>All</asp:ListItem>

<asp:ListItem>Games</asp:ListItem>

<asp:ListItem>Websites</asp:ListItem>

<asp:ListItem>Applications</asp:ListItem>

<asp:ListItem>Playthings</asp:ListItem>

<asp:ListItem>Cms</asp:ListItem>

<asp:ListItem>Flash</asp:ListItem>

<asp:ListItem>Html</asp:ListItem>

</asp:DropDownList>

</td>

<td>

<ctrl:ImageButtonID="btnNextProject"runat="server"CssClass="next"ImageUrl="~/assets_new/images/btn_next.gif"OnClick="btnNextProject_Click"BorderWidth="0"AlternateText="Next"/>

</td>

</tr>

</table>

</td>

<tdclass="col3">

</td>

</tr>

</table>

<divid="projects">

<ctrl:FilterListID="lstProjects"runat="server"MaxVisibleItems="6">

<ctrl:FilterListItemrunat="server"Image="repository/uploads/projects/ilovedust.jpg"Title="ILoveDust"ProjectLink="http://www.unwrong.com/projects/ilovedust/"LiveLink="http://www.ilovedust.com">

<ctrl:Categoriesrunat="server">

<ctrl:Categoryrunat="server">Flash</ctrl:Category>

<ctrl:Categoryrunat="server">Cms</ctrl:Category>

<ctrl:Categoryrunat="server">Favourites</ctrl:Category>

<ctrl:Categoryrunat="server">Websites</ctrl:Category>

</ctrl:Categories>

</ctrl:FilterListItem>

<ctrl:FilterListItemrunat="server"Image="repository/uploads/projects/tado.jpg"Title="Tado"ProjectLink="http://www.unwrong.com/projects/tado/"LiveLink="http://www.tado.co.uk">

<ctrl:Categoriesrunat="server">

<ctrl:Categoryrunat="server">Flash</ctrl:Category>

<ctrl:Categoryrunat="server">Favourites</ctrl:Category>

<ctrl:Categoryrunat="server">Websites</ctrl:Category>

</ctrl:Categories>

</ctrl:FilterListItem>

<ctrl:FilterListItemrunat="server"Image="repository/uploads/projects/communicatorworld.jpg"Title="Communicator World"ProjectLink="http://www.unwrong.com/projects/communicator/"LiveLink="http://www.communicatorworld.co.uk">

<ctrl:Categoriesrunat="server">

<ctrl:Categoryrunat="server">Flash</ctrl:Category>

<ctrl:Categoryrunat="server">Cms</ctrl:Category>

<ctrl:Categoryrunat="server">Favourites</ctrl:Category>

<ctrl:Categoryrunat="server">Websites</ctrl:Category>

</ctrl:Categories>

</ctrl:FilterListItem>

</ctrl:FilterList>

</div>

</ContentTemplate>

</asp:UpdatePanel>


Hi,smeeg

This happens when the machineKey used to encrypt/decrypt the viewstate was changed, and more likely this will happen if you keep the page idle for a long time. To avoid this, you need to have a static machineKey.

Check this articlehttp://blog.g9th.com/2007/01/14/unable-to-validate-data-at-systemwebconfigurationmachinekeysectiongetdecodeddata.aspx

Let me know if you need more info.
You can also see this thread for more help:http://forums.asp.net/t/1115331.aspx

Thanks

NOTE:This response contains a reference to a third party World Wide Web site. Microsoft is providing this information as a convenience to you. Microsoft does not control these sites and has not tested any software or information found on these sites; therefore, Microsoft cannot make any representations regarding the quality, safety, or suitability of any software or information found there. There are inherent dangers in the use of any software found on the Internet, and Microsoft cautions you to make sure that you completely understand the risk before retrieving any software from the Internet.

PageRequestManagerParserErrorException in my AJAX Web Page

Hi All,

I have started to get this intermittent error when I try to open my web site. The starting page uses the Accordion AJAXToolKit Control and a couple of update panels. I noticed that the PageRequestManagerParserErrorException error does not occur every time. Has anyone encountered this error and figured out the solution to this problem?

Thanks in advance

RK

See this article:

http://weblogs.asp.net/leftslipper/archive/2007/02/26/sys-webforms-pagerequestmanagerparsererrorexception-what-it-is-and-how-to-avoid-it.aspx


Great thanks. That helped me out. For others benefit I will just post a short blurb of the problem and the resolution. To start with the URL above is very informative.

The problem was that I am using a login control where the user enters the username and password and logs into my website. In my Login Control I had set the DestinationPageUrl to the page I wanted to display after the user was successfully logged in. The problem was occuring when that page was being displayed as it has a few update panels and I guess the client browser was receiving html that it did not know how to render. Thus the ParseRequestManagerParserErrorException.

Resolution: I changed my code to handle the "LoggedIn" event of the Login Control. I do an explicit Response.Redirect to display the page I want to display. This fixed the problem.

I am wondering if the Login Contol does a Server.Transfer instead of response.redirect. I know that the URL above mentions that a Server.Transfer can cause the problem to occur. Anywho I am happy :)

Reddy

PageRequestManagerServerErrorException error code 403 and 502

Hi

Im having troubles like that but the error code is different.

im getting the error codes 502 and 403, i have no idea what does they mean... also on some computers, users can work on it for hours, and the message never apears..

and on another few computers, it apears as soon as the page loads, when the user comes back to the page, in the middle of the function, apparentli as random as it can be...

also, i have no login or user authentication on the page, and really have read al the forums but have no idea why or what does the error means... not even what causes it...

Heeeeelp im drownin!!!Can you provide details about your code...
So that it will be helpful to solve the problem..

Well, my code is an updatepanel, whith a common panel inside...

as soon as some values are selected in some dropdowns outside the updaqte panel, the panel, inside de update panel turns visible and a gridview is filled.

this gridview has buttons, and when a buton is pressed, the row is transferes to another grid view.

finally, the selected rows are sendt to another page.

but the strange part is that the problem apears only on some computers, and not on particular events, like just pressing a button or displayn a drop down...

the error comes randomly on those computers...

hope someone can help me


Check this url

http://ajax.asp.net/docs/overview/UpdatePanelOverview.aspx


GridView inside UpdatePanel not supported fully

well i dont guess that the gridvie is the problem... because in most of the computers at the ofice, the error is never displayed... but ive ad no luck on solving the reason for that...

any other ides?


Hi,

I am having problems and errors very similar to what you describe here. Have you ever found a cause and/or resolution?

Thanks.


http://forums.asp.net/p/1038043/1438409.aspx#1438409


That is a very interesting link to a post, in that it attributes these problems to having Trace enabled. I checked my code, and although I have many Trace.Warn statements throughout my code, Trace is explicitly disabled on all the pages where there is a Trace attribute in the @.Page directive.

Thanks anyways, but I am still searching for an answer to these problems my site is having.

Dan

PageRequestManagerServerErrorException error code 12029

We seem to intermittently get a PageRequestManagerServerErrorException with the error code 12029, could someone explain that error code or point to documentation ? This happens on about 1 / 40 requests and the page is nothing special, just a datagrid inside an updatepanel and with a custom progressbar which is just a div with an animated gif that appears on beginRequest and hides on endRequest.

When you see this error is in an alert box from javascript? Are you using the latest and greatest release?

Is this on a form that requires the user to be logged in..it may be could not authenticate error... If you use fiddler and attach to it - it will actually give you the real error message on why it was aborted...if you do the digging...The SCM traps and surpresses alot of the serverside errors (in my opinion)... so when a session expires...unfortunately the ajax error codes do not map to IIS error codes...


I get the same ...

Have a ticker-tape-liek page that updates every 5 seconds .. eventually, teh session expires on teh authenticated page and I get this nasty message.


I get the same ...

Have a ticker-tape-liek page that updates every 5 seconds .. eventually, the session expires on teh authenticated page and I get this nasty message.


So the problem is the session expiring? Can you use sliding experation in forms? So the user will stay there as long as there are requests from that session?

Two solutions for you:

1. One change your web.config to allow for longer sessions - by default I think .Net 2.0 the timeout is 10 minutes (in 1.1 it was 15)

<authentication mode="Forms">
<forms loginUrl="Users_Login.aspx"timeout="555555555"/>
</authentication>

2. If that is an issue - create a IFRAME that loads a blank .aspx page that has the meta tag refresh to like every 10 minutes or something - and embedded it at the bottom of the page and merely add the style: display: none to it (so it doesn't actually show but is still visible...

3. If the ticker is calling back to the server to update the ticker or whatever - change the service you are using to actually also check for authentification (I am not sure how the authentification service works that Ajax has - but I believe the ajax.asp.net sdocumentation site has some examples...(so I don't really call this a solution ...as I have no idea how to implement it...)

The above should help you with your situation...


Hi!

I'm getting the same error, it's happening completely random and i'm sure it's not time out related

Besides any workaround, I think that the best way to solve it would be to be able to know what's error number 12029.

Any of the AJAX developers could clarify this?

Regards,

Juan


Are you using fiddler? You should...It'll tell you what exactly caused the error...there are also a couple of good extensions for firefox that will help debug the issue as well...

Also note that setting compilation debug to true and trace enabled also cause sporadic behavior when it comes to ajax...Also - do a search on the forums here for exception handling - it is possible to track the exception generated by ajax and log it... and there a few forum posts on the procedure for doing this (also code examples on the ajax.asp.net documentation site)...


Jody, thanks for your answer,


- It happens with or without debug=true: i'm testing it with the VS ASPNET server, with IIS 5 and with IIS 6. It happens everywhere and randomly, regardless of the debug setting. And I'm not tracing anywhere.

- I'm already logging the exception into SQL using this:

Protected Sub ScriptManager1_AsyncPostBackError(ByVal sender As Object, ByVal e As Microsoft.Web.UI.AsyncPostBackErrorEventArgs) Handles ScriptManager1.AsyncPostBackError
Dim conn As New SqlConnection
Try
conn.ConnectionString = ConfigurationManager.ConnectionStrings("ApplicationDatabase").ConnectionString
Dim comm As SqlCommand = conn.CreateCommand
comm.CommandText = "AjaxRecordError"
comm.CommandType = CommandType.StoredProcedure
comm.Parameters.AddWithValue("exMessage", e.Exception.Message)
comm.Parameters.AddWithValue("exStack", e.Exception.StackTrace)
comm.Parameters.AddWithValue("exSource", e.Exception.Source)
comm.Parameters.AddWithValue("exServerName", Server.MachineName)
comm.Parameters.AddWithValue("date", DateTime.UtcNow)
comm.Parameters.AddWithValue("ip", Request.UserHostAddress)
conn.Open()
comm.ExecuteNonQuery()
Catch ex As Exception
Finally
conn.Close()
End Try

So, i'm actually tracking the exception, but it isn't very helpful anyway (at least for me! :) ) :

Here is one of the records (which are all the same BTW):

exception.Message = "Input string was not in a correct format."

exception.StackTrace = " at System.Number.StringToNumber(String str, NumberStyles options, NumberBuffer& number, NumberFormatInfo info, Boolean parseDecimal)
at System.Number.ParseInt32(String s, NumberStyles style, NumberFormatInfo info)
at System.Web.UI.WebControls.ImageButton.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.WebControls.ImageButton.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection)
at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad)
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)"

exception.Source = "mscorlib"

I can see from this that is something related with parsing (I think), but as it's happening randomly, without pattern, I can't find where to start looking at.

And, finally, I'm already using Fiddler, but I must admit that I don't know where to dig to help me with the issue.

Any further help would be really appreciated! :)

Juan


Idea here:

Fiddler can be confusing sometimes. It does a take a bit to analyze...The important ones to look at are naturally any 404 errors.. Check the Headers tags when you go clicking through to inpect...

However, - I have found that that with XP - that the number of connections is limited to 10 using the IIS 5 server for XP... This causes issues because at times it doesn't matter how many times you restart IIS or close and open the broswer it doesn't go away sometimes.

I am asuming that you are stating that you are getting these errors from a remote server and not your dev xp machine?

Check your event log under applications:

The following exception was thrown by the web event provider 'EventLogProvider' in the application '/SitesEasyTest' (in an application lifetime a maximum of one exception will be logged per provider instance):

System.Web.HttpException: The EventLogWebEventProvider provider failed to log an event with the error code 0x800705DE.
at System.Web.Management.EventLogWebEventProvider.ProcessEvent(WebBaseEvent eventRaised)
at System.Web.Management.WebBaseEvent.RaiseInternal(WebBaseEvent eventRaised, ArrayList firingRuleInfos, Int32 index0, Int32 index1)

For more information, see Help and Support Center at

Is symbolic of too many connections from one client and events are occuring so rapidly that the application can can not throw any more exceptions due to connection issues...

Another error to check is this one:

Event code: 3005
Event message: An unhandled exception has occurred.
Event time: 11/4/2006 1:25:21 PM
Event time (UTC): 11/4/2006 9:25:21 PM
Event ID: 956e4d1c3b334e5895a42e0f0706badc
Event sequence: 32
Event occurrence: 2
Event detail code: 0

Application information:
Application domain: /LM/W3SVC/1/Root/SitesEasyTest-7-128071478278125000
Trust level: Full
Application Virtual Path: /SitesEasyTest
Application Path: D:\Sites-Easy\Web\
Machine name: SITES-EASY

Process information:
Process ID: 1472
Process name: aspnet_wp.exe
Account name: SITES-EASY\ASPNET

Exception information:
Exception type: NullReferenceException
Exception message: Object reference not set to an instance of an object.

Request information:
Request URL: http://localhost/SitesEasyTest/default.aspx
Request path: /SitesEasyTest/default.aspx
User host address: 127.0.0.1
User:
Is authenticated: False
Authentication Type:
Thread account name: SITES-EASY\ASPNET

Thread information:
Thread ID: 6
Thread account name: SITES-EASY\ASPNET
Is impersonating: False
Stack trace: at Cavalia.SkinHandler.GridViewModal.InitializeSkin(Control skin) in D:\Sites-Easy\Core Modules\Cavalia.SkinHandler\GridViewModal.cs:line 322
at Cavalia.SkinHandler.SkinnedCommunityControl.CreateChildControls() in D:\Sites-Easy\Core Modules\Cavalia.SkinHandler\SkinnedCommunityControl.cs:line 223
at System.Web.UI.Control.EnsureChildControls()
at Cavalia.Admin.EditSectionsDefault.OnLoad(EventArgs e) in D:\Sites-Easy\Admin\Admin\EditSections\EditSectionsDefault.cs:line 244
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)


Custom event details:

For more information, see Help and Support Center at

This one while confusing - when compared to the corresponding SCM error message - is actually that the SCM tried processing a request but the connection was reset yet - it still trys to restablish as another event needs something - such as say image retrieval for rebuilding the page. I had issue as well and it ended up being a image that when the ajax update panel was initialized the first time - all worked well, but then on subsequent requests - the failure on the image always caused the 'Input String of the Format" as the SCM expected a image but instead it got a 404 error page from the server...the page still rendered properly and worked after clicking ok on the error... none theless once I corrected that - I stopped getting the errors..

I think that those developing the SCM should also check the stream incoming and abort on the processing of those kind of messages...depending on the type that the scm is trying to request...

See if any of that helps.. Also - try it with the browser settings not set to Every Time and instead Automatically. If its a connection issue you may find that the issue does stop appearing as in alot of cases - I'll see 30 some requests constantly if say I am loading multiple dynamic controls in say a modal popup or something...


Jody, thanks for your info.

BTW, i;m getting this errors from BOTH my local dev machine with WIn XP and from the remote staging server with Windows Server 2000 R2.

It's interesting what you say about images, because my error is happening after refreshing a GridView that's inside an UpdatePanel, and this GridView contains a lot of templated columns with graphics.

Also, after clicking "ok" on the javascript alert the page just renders fine and you are know until the next random error happens.

I think it's worthwhile to try into that direction, before something else. Could you please share with me the solution you've used to correct that?. I know that in the AJAX documentation there is information about how to handle custom errors, but it involves writing javascript, on which i'm not very good. I just want to "clear" the error and not display an alert conditioned to if the error is of type "Input String of the Format"

Regards,

Juan


<authentication mode="Forms">
<forms loginUrl="Users_Login.aspx"timeout="555555555"/>
</authentication>

AH!! Then any hit to the website will create a session that will use memory for ever, if I create a program that hits the website every second in less than an hour the garbage collection will be kicking in!Stick out tongue


<authentication mode="Forms">
<forms loginUrl="Users_Login.aspx"timeout="555555555"/>
</authentication>

AH!! Then any hit to the website will create a session that will usememory for ever, if I create a program that hits the website everysecond in less than an hour the garbage collection will be kicking in!Stick out tongue

Actually - you are incorrect - the session will not remain in memory forever on the server side... it merely means that the authentification cookie is not expired...and therefore continuous checks are not made if the cookie is valid... therefore when the authentification occurs it doesn't actually have to do the whole process... the timeout period merely says keep the authentication cookie valid for x period of time... If your case was correct - sites like this would either a billion servers or constantly crash...Sever side - it would not matter a session is a session...it will be created regardless - the server side session management still purges inactive sessions from memory on regular basis - all the timeout value does is instruct that if the user connects again - don't destroy the cookie when re-authenticating and consider it valid instead...and use what is stored instead of going through the whole process of reconstruction...

See this article for more info on this...


Don't quote me on this as my memory is foggy on Windows 2000. Windows 2000 actually has a connection limit per client / machine. There is a registry change you can do to increase this...however, it does expose a security risk so modify with caution .. I'll give you reference to this doc:download.microsoft.com/download/2/8/0/2800a518-7ac6-4aac-bd85-74d2c52e1ec6/tuning.doc

As for how I fixed my issue... I fixed all of the urls for the images...

I'll give you a caveat however... if you use a dynamic site structure... one of two of these observations may be relevant to you.

1. With dynamic sites - in some cases the urls being requested are mapped to the root url of the site and not the actual dynamic url that should be generated - So, I fixed that code in the toolkit and recompiled. That solved half of my problems... (See my blog entry titled "Bizzarre"... how ever - if you are using master pages and all that then it won't be relevant to you...

2. I had and still have had issues with dynamically generating url paths when a SCM is on the page.

For instance - I rely heavily on this kind of syntax: ImageUr l= '<%# ResolveUrl("~/Images/admin/collapse.jpg")%>'

It generates the actual physical path to the image. It doesn't work in a page with a SCM..(although does everywhere else) So I have to resort to defining the imageurl in codebehind - which does work...And this goes for the Gridview. Defining images statically (int the ascx or aspx page) works but not if some kind of dynamic generation in the aspx or ascx page...but if you do it codebehind - it works...

So correcting both of those issues resolved my issue (keep in mind that each request for a image is actually a separate connection to the server)...

For suppressing the error message and 'pretending it didn't happen on the client side..... there is a great example on the docs site...

So, hopefully that will help...

PageRequestManagerServerErrorException error code 12002

Hi , i'm having this problem, i need to run an store procedure from a aspx page and i'm having this error. It seems that is an request time out. The Procedure last almost 1 hour and 15 minutes. Please help me.

the message i have is ... and it's shown by the 60 minute of execution.

I'm using Ajax v 1.0. , ScriptManager and UpdatePanel.

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error ocurred while processing the request
on the server. The status code reutrned from the server was: 12002

Hi Tony,

You can set the AsyncPostBackTimeout property of the ScriptManager. In your scenario, you can define it to be about 1 hour and a half (5400 secs).
Just make sure that the other time-out variables (session, forms authentication cookie and roles cookie) are not interfering as well.

Also, check the httpRuntime executionTimeout property if you are working with file uploads.

I hope this helps,

Juan


Hi Tony, I am facing same problem, PageRequestManagerServerErrorException error code 12002 exception. My procedure takes apprx 2hrs to run..

goyou have got any solution please pass it to me atshiekh.Bilal@.gmail.com

Thanks

Bilal


Hi Tony, I am facing same problem, PageRequestManagerServerErrorException error code 12002 exception. My procedure takes apprx 2hrs to run.. goyou have got any solution please pass it to me atshiekh.Bilal@.gmail.com

Thanks Bilal

PageRequestManagerServerErrorException 12019 12130 12031 and 12152

Any ideas what causes the following error message:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code is:

I receive one of 4 error numbers: 12019 12130 12031 or 12152

I believe it might have to do with a content switch but not sure. Any help would be greatly appreciated.

I am getting the same Error Message with error number :12031...

Any suggestion ?


Hi,

Please refer to this:http://support.microsoft.com/kb/193625

The issue seems to be with the WinInet api, may be you can try to access it with another browser to see if it works.


Hi,

it is true that it is about Wininet api.i can access my page and can work with Another browsers but with IE 7.0 OR 6.0 i come accross with this error.(in I.E The error code is 404)..What is ur advice to solve this problem?When i launch the project without connecting to source safe,it works but after i connect to sourcesafe,this problem occurs..This error is very annoying.What should i do?Thank u very much for ur Help.(My problem doesnt depend on Data Intesivity or row count)


Raymond Wen - MSFT:

Hi, Please refer to this:http://support.microsoft.com/kb/193625

The issue seems to be with the WinInet api, may be you can try to access it with another browser to see if it works.

So, seeing this error on a partial-page update (UpdatePanel Async postback) means that the application I'm developing is not going to work with Internet Explorer? Or is this just a fluke that will go away on a restart / deployment scenario / etc.

I'm getting this one:

 12019 ERROR_INTERNET_INCORRECT_HANDLE_STATE
The requested operation cannot be carried out because the handle supplied is not in the correct state.



Hi

we had the same problem on our live-system. It was caused by SSL-Connection. If you have SSL, try turning off Keep Alive for IE.


hth


Just so you know, we did find one possible cause of this problem.

It seems to crop up sometimes if you are using IE6 supplied with MultipleIEs package.

http://forums.asp.net/t/1123365.aspx

PageRequestManagerServerErrorException (Status Code: 413)

I hope someone can help me.

This is the message:
- Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 413.

The scenerio is quite simple: A master page contains the Script Manager. The others pages have their own update panels and controls (nothing special, just list box and grids).

Sometimes the above error ocurrs, sometimes not.

The application is on HTTPS and requires client certificates.

Any idea?

Regards,
Alano

Hi Alano,

The status code 413 means that Request Entity Too Large.
The 413 status code indicates that the request was larger than the server is able to handle, either due to physical constraints or to settings. Usually, this occurs when a file is sent using the POST method from a form, and the file is larger than the maximum size allowed in the server settings.

Please?try?to set the maxRequestLength property to a larger value. For how, please refer to this:
http://msdn2.microsoft.com/en-us/library/e1f13641.aspx

Hope this helps.

Raymond,

Thanks very much for your answer, the first about this problem I've seen on the Internet.
Our web.config already has a maxRequestLength set to 2000000. We don't expect use this, but we have it on web.config. I also have set the UploadReadAHeadSize on IIS 6.0 to 64k.
If you have another hint, I'll appreciate that.

Thanks again.

Alano.


We solved our problem, I suppose, with a IIS metabase parameter (UploadReadAHeadSize).
Some pages of our web site has more than 80k. I have set the that IIS metabase parameter to 128k and things are going now.
For more information you can see:
http://technet2.microsoft.com/windowsserver/en/library/0ef55842-24d2-4060-bb98-d69e2877a6671033.mspx?mfr=true

PageRequestManagerServerErrorException, status code 504

I got the following error message on my ASP.NET AJAX web app:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 504

What does it mean?Huh?

Hi monkeyno,

10.5.5 504 Gateway Timeout

The server, while acting as a gateway or proxy, did not receive a timely response from the upstream server specified by the URI (e.g. HTTP, FTP, LDAP) or some other auxiliary server (e.g. DNS) it needed to access in attempting to complete the request.

 Note: Note to implementors: some deployed proxies are known to return 400 or 500 when DNS lookups time out.

To troubleshoot this issue, we really need the source code to reproduce the problem, so that we can investigate the issue in house. It is not necessary that you send out the complete source of your project. We just need a simplest sample to reproduce the problem. You can remove any confidential information or business logic from it.

You get the Sys.WebForms.PageRequestManagerServerErrorException whenever the aspx handler throws an exception responding to an ajax.net update panel submit. If you took away the update panels you would see the classic asp.net exception page with lots of potentially useful information like the stack trace, but since the form submit has been ajaxified you just get a generic error message through a javascript alert. For example create an aspx page with an update panel containing a button and a multiline text control with the text set to "".

monkeyno:

Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server.

Clicking on the button you'll get the generic error: The status code returned from the server was: 500 Now try it again after placing the controls outside of the update panel. When you click the button you will get an exception page with details about a potentially dangerous/script-attack form value. The exception evens details a possible (though non-recommended) workaround of adding the attribute, ValidateRequest="false", to the aspx page directive. Of course for a real page it's a pain to strip out the update panels, so here is a quicker way to see the exception details. Just add the attribute, EnablePartialRendering="false", to your ScriptManager like below. Just set it back when you're done troubleshooting the issue.

Saturday, March 24, 2012

PageRequestManagerServerErrorException with error code 500

I am working on an ASP.NET AJAX web application. I got a PageRequestManagerServerErrorException with error code 500 every time when I try to populate a text box with a string contains some HTML tags (like <BR> for example). The full error message "Sys.WebForms.PageRequestManagerServerErrorException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500" appears in an alert box from javascript.
The main problem is that every next async post back generates the same error on the client side. Of course, I can check the passing string preliminarily, but my question is:
Is there a way to handle an error like this so the web application continues to run?
I have already check to clear error in Application Context on Application_Error event with Context.ClearError(), but it does not affect.

Hi!,

That exception is a callback exception and the PageRequestManager is the AJAX ScriptManager control.

You could customize the callback errors using the AsyncPostBackErrorMessage property of the ScriptManager.

Also, if you want to handle the error on server-side, use the ScriptManager_AsyncPostBackError event.

Please refer to this:http://support.microsoft.com/kb/193625

Check this articlehttp://blog.g9th.com/2007/01/14/unable-to-validate-data-at-systemwebconfigurationmachinekeysectiongetdecodeddata.aspx

Let me know if you need more info.
You can also see this thread for more help:http://forums.asp.net/t/1115331.aspx


Hi chetan.sarode!

Thank you for your post.

Yesterday I tried to handle this error on ScriptManager_AsyncPostBackError event, but unfortunately it doesn't fire.

The only one event I found to handle is Application_Error on Global.asax. I could ClearError in current HttpContext, but it doesn't affect on client side. The error still apears after every next async post back (the only difference is that alert box in javascript with the error message doesn't appear).

So, is there a way to prevent the response from the server to the client in that case. I mean it is better for me, the server sends nothing to the client instead of an error that stops every next async post back.

I appreciate any advice.

Thanks again.


I will look into that more...

Will let u knowSmile


Hi,

I got the same error a few days ago.

The following is my code that got the error:

<%@. Page Language="C#" %>

<%@. Import Namespace="System.Xml" %>
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.IO" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToString();

//string strxml = "<books><book>asp</book><book>asp1</book><book>asp2</book></books>";
string strxml = HiddenField1.Value;//.Replace("begin", "<").Replace("end", ">").Replace("slash", "/");
//DataSet myDS = new DataSet();
//XmlTextReader xtr = new XmlTextReader(new StringReader(strxml));
//myDS.ReadXml(xtr);
//DropDownList1.DataSource = myDS;
//DropDownList1.DataValueField = "book";
//DropDownList1.DataTextField = "book";

System.Xml.XmlDocument sa = new System.Xml.XmlDocument();
sa.LoadXml(strxml);
System.Xml.XmlNodeList saa = sa.GetElementsByTagName("book");
DropDownList1.DataSource = saa;
DropDownList1.DataValueField = "InnerText";
DropDownList1.DataTextField = "InnerText";

DropDownList1.DataBind();
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>

<script language="javascript" type="text/javascript">
// <!CDATA[

function Button2_onclick() {
document.getElementById("HiddenField1").value = test.XMLDocument.xml;
// var a = "";
// while(document.getElementById("HiddenField1").value != a){
// var a = document.getElementById("HiddenField1").value;
// document.getElementById("HiddenField1").value = document.getElementById("HiddenField1").value.replace("<","begin");
// document.getElementById("HiddenField1").value = document.getElementById("HiddenField1").value.replace("/","slash");
// document.getElementById("HiddenField1").value = document.getElementById("HiddenField1").value.replace(">","end");
// }
document.getElementById("Button1").click();
}

// ]]>
</script>

</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList><div style="visibility: hidden">
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</div>
<input id="Button2" type="button" value="button" onclick="return Button2_onclick();" />
<asp:HiddenField ID="HiddenField1" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
<xml id="test">
<books>
<book>asp</book>
<book>asp1</book>
<book>asp2</book>
</books>
</xml>
</form>
</body>
</html>

I resolved it by changing the code into the following code:

<%@. Page Language="C#" %>

<%@. Import Namespace="System.Xml" %>
<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.IO" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
Label1.Text = DateTime.Now.ToString();

//string strxml = "<books><book>asp</book><book>asp1</book><book>asp2</book></books>";
string strxml = HiddenField1.Value.Replace("begin", "<").Replace("end", ">").Replace("slash", "/");

//DataSet myDS = new DataSet();
//XmlTextReader xtr = new XmlTextReader(new StringReader(strxml));
//myDS.ReadXml(xtr);
//DropDownList1.DataSource = myDS;
//DropDownList1.DataValueField = "book";
//DropDownList1.DataTextField = "book";

System.Xml.XmlDocument sa = new System.Xml.XmlDocument();
sa.LoadXml(strxml);
System.Xml.XmlNodeList saa = sa.GetElementsByTagName("book");
DropDownList1.DataSource = saa;
DropDownList1.DataValueField = "InnerText";
DropDownList1.DataTextField = "InnerText";

DropDownList1.DataBind();
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>

<script language="javascript" type="text/javascript">
// <!CDATA[

function Button2_onclick() {
document.getElementById("HiddenField1").value = test.XMLDocument.xml;
var a = "";
while(document.getElementById("HiddenField1").value != a){
var a = document.getElementById("HiddenField1").value;
document.getElementById("HiddenField1").value = document.getElementById("HiddenField1").value.replace("<","begin");
document.getElementById("HiddenField1").value = document.getElementById("HiddenField1").value.replace("/","slash");
document.getElementById("HiddenField1").value = document.getElementById("HiddenField1").value.replace(">","end");
}
document.getElementById("Button1").click();
}

// ]]>
</script>

</head>
<body>
<form id="form1" runat="server">
<div>
<asp:ScriptManager ID="ScriptManager1" runat="server">
</asp:ScriptManager>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="Label1" runat="server" Text="Label"></asp:Label>
<asp:DropDownList ID="DropDownList1" runat="server">
</asp:DropDownList><div style="visibility: hidden">
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
</div>
<input id="Button2" type="button" value="button" onclick="return Button2_onclick();" />
<asp:HiddenField ID="HiddenField1" runat="server" />
</ContentTemplate>
</asp:UpdatePanel>
</div>
<xml id="test">
<books>
<book>asp</book>
<book>asp1</book>
<book>asp2</book>
</books>
</xml>
</form>
</body>
</html>

For more information,seehttp://forums.asp.net/t/1126640.aspx(embedded xml datasource)

Thanks

PageRequestManagerServerErrorException with 500 error code

In javascript I'm setting the value property of a button within an update panel before calling click() on the button to refresh the update panel. (I need to refresh an update panel and pass extra data on the callback, and no one on this forum has yet described a better way of doing it than this.)

This was all working in tests that I did last week, but I'm now getting the following error message box in IE:

"Sys.WebForms.PageRequestManagerServerErrorException: An unkown error ocurred while processing the request on the server. The status code returned from the server was: 500"

Any ideas?

I have the same error but on a couple of dropdown which update one another's datesource with updatePanels.

If i change the value of the first dropdown for several times, always the third tine gives this error.

I found on a post the setting TRACE off resolves but not for me.

Any ideas ?

Just try to change frequently some controls which use updatepanels (for other controls) and see what's happen.

Thank's

Sorin


I found also that If I have more than 3 UpdatePanels in a Page I get this error after 3 callbacks.

If I have on page Trace="false"and "EnableEventValidation="true"

I get this error:

Invalid postback or callback argument. Event validation is enabled using <pages enableEventValidation="true"/> in configuration or <%@. Page EnableEventValidation="true" %> in a page. For security purposes, this feature verifies that arguments to postback or callback events originate from the server control that originally rendered them. If the data is valid and expected, use the ClientScriptManager.RegisterForEventValidation method in order to register the postback or callback data for validation.

Thank's again


I've also tried setting the value of a hidden field and a hidden textbox and both raise the same error.

I cannot even paste data into a textbox and then do a postback without getting this error.

I'm also EXTREMELY TIRED OF MICROSOFT IGNORING ALL OF MY POSTS!!!!!!!!!!! Angry

PageRequestManagerServerException

I have a callback funtion but I get the following error when I use this when the login credential has expired:

Sys.WebForms.PageRequestManagerServerException: An unknown error occurred while processing the request on the server. The status code returned from the server was: 500

I.e It tries to get information from a function that is not reachable as the user has been loged out.

If the page is reloaded i will get rerouted to the login page but as i don't reload the page and only using a callback i don't get rerouted - i only get the above error message.

Any Ideas?

You can capture the error on the client side and redirect the user there using the Javascript window.location

Seehttp://www.asp.net/AJAX/Documentation/Live/tutorials/CustomizingErrorHandlingforUpdatePanel.aspx for handling errrors from the UpdatePanel; if you are using PageMethods seehttp://www.singingeels.com/Articles/Using_Page_Methods_in_ASPNET_AJAX.aspx for capturing errors.

-Damien


Try to capture asynchronous post back error as the follow.


ScriptManager.AsyncPostBackError += new EventHandler<AsyncPostBackErrorEventArgs>(ScriptManager_AsyncPostBackError);


Determine if it is asynchronous post back : ScriptManager.IsInAsyncPostBack;

Get synchronous post back error message: ScriptManager.AsyncPostBackErrorMessage;


Get asynchronous post back source: ScriptManager.AsyncPostBackSourceElementID;

Let me know if this helpful to you

PageRequestManagerServerErrorException: 404 ??

I have a error when I use Server.Transfer and ASP.NET AJAX.

STEPS:

1- navigate to a page containing a UpdatePanel using SERVER.TRANSFER
2- (first) async call works fine

3 - click again to make second async call and somehow the page path becomes
invalid; the page name is correct but the path seems to belong to the
referer!! (Consequently a 404 server response is returned by the server. see
attached error message )

Anyone help-me?

Server.Transfer really doesn't work well with ASP.NET AJAX. A few people have done some complicated stuff to get it to work, but I recommend just avoiding it altogether if possible. Search around here on the forums, and you can probably find some older discussions of this.

Paging a GridView in an UpdatePanel

Has anyone been able to implement paging for a GridView inside an UpdatePanel?

I get a JavaScript error everytime I click on the page number: "Object Required".

Enclosing the GridView control inside an UpdatePanel worked fine for me, including the paging.

Have you tried stepping through your code with VisualStudio? This works really good for me when debugging atlas. Also if your gridview is bound to a SqlDataSource you can enable PagingAndSortingCallbacks, and that has the same effect.


hello.

can you show us your code?

<atlas:ScriptManagerID="ScriptManager1"runat="server"EnablePartialRendering="true"/>

<atlas:UpdatePanelID="EmpOrders"runat="server"Mode="Conditional">

<Triggers><atlas:ControlEventTriggerControlID="Button1"EventName="Click"/></Triggers>

<ContentTemplate>

<asp:ButtonID="Button1"runat="server"Font-Italic="True"OnClick="Button1_Click1"Text="Search"/><br/>

<asp:GridViewID="GridView1"runat="server"CellPadding="4"ForeColor="#333333"GridLines="None"PageSize="15"AllowPaging="True"AutoGenerateColumns="False"OnPageIndexChanging="GridView1_PageIndexChanging"AllowSorting="True">

<Columns>

<asp:BoundFieldDataField="ShipName"HeaderText="Ship Name"SortExpression="ShipName"/>

<asp:BoundFieldDataField="ShipCountry"HeaderText="Country"SortExpression="Country"/>

<asp:BoundFieldDataField="Freight"HeaderText="Freight"SortExpression="Freight"/>

</Columns>

</asp:GridView>

</ContentTemplate>

</atlas:UpdatePanel>

Codebehind:

protectedvoid GridView1_PageIndexChanging(object sender,GridViewPageEventArgs e)

{

GridView1.PageIndex = e.NewPageIndex;

BindGrid();

}


hello.

well, it looks ok to me.

there's one thing i don't understand: you've added a trigger to the panel and configured it against a button which is also placed inside the panel...

i've built a small page that is working ok here (i've built a struct to simulate the info that is passed as source of the grid). see if it works with your current configuration:

public struct Ship
{
private string _shipName;

public string ShipName
{
get { return _shipName; }
set { _shipName = value; }
}
private string _shipCountry;

public string ShipCountry
{
get { return _shipCountry; }
set { _shipCountry = value; }
}
private string _freight;

public string Freight
{
get { return _freight; }
set { _freight = value; }
}

public Ship( string shipName, string shipCountry, string freight )
{
_shipName = shipName;
_shipCountry = shipCountry;
_freight = freight;
}
}

protected override void OnLoad(EventArgs e)
{
base.OnLoad(e);
if (!this.IsPostBack )
{
BindGrid();
}
}

void BindGrid()
{
Ship [] shippes = new Ship[]{
new Ship( "1","1","1" ),
new Ship( "2","2","2" ),
new Ship( "3","3","3" )
};

GridView1.DataSource = shippes;
GridView1.DataBind();
}

protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{

GridView1.PageIndex = e.NewPageIndex;

BindGrid();

}

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page
</head>
<body>
<form id="form1" runat="server">
<atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="true"/>
<atlas:UpdatePanel ID="EmpOrders" runat="server" Mode="Conditional">
<Triggers>
<atlas:ControlEventTrigger ControlID="Button1" EventName="Click"/>
</Triggers>
<ContentTemplate>
<asp:Button ID="Button1" runat="server" Font-Italic="True" Text="Search"/><br/>
<asp:GridView ID="GridView1" runat="server" CellPadding="4" ForeColor="#333333"
GridLines="None" PageSize="2" AllowPaging="True"
AutoGenerateColumns="False" OnPageIndexChanging="GridView1_PageIndexChanging" AllowSorting="True">
<Columns>
<asp:BoundField DataField="ShipName" HeaderText="Ship Name" SortExpression="ShipName"/>
<asp:BoundField DataField="ShipCountry" HeaderText="Country" SortExpression="Country"/>
<asp:BoundField DataField="Freight" HeaderText="Freight" SortExpression="Freight"/>
</Columns>
</asp:GridView>
</ContentTemplate>
</atlas:UpdatePanel>
<%= DateTime.Now.ToString() %>
</form>
</body>
</html>

Are you doing custom paging? I'm asking because normally, the GridView control takes care of this automatically (as well the binding -- unlike in DataGrid) so that you don't even have to handle the event. This is assuming that your datasource can handle paging (DataSet does I believe).


hello guys, and yes, i think that he is using the asp.net 1.X binding instead of using the new data source controls...

Yes I′m handling the binding as with .NET v1.x


hello again.

Can you run the sample page i've presented in a previous post?

Luis, your example works fine. The only difference between your code and mine is that you use a Struct as your datagrid's datasource and I use a DataSet.

What do you think?


hello.

well, i think that using a dataset shouldn't make any difference. can you build a sample page that uses a dummy dataset to reproduce the problem and post it here?
I have the same problem using an SQLDatasource. Is it possible that it only work with dataset because with dataset you can generate XML. Maybe with SqlDatasource it doesn't generate Xml so Atlas on gridview with SqlDatasource will no work ?
Luis, I′m working on the dummy page. In the meantime, I noticed that having

EnablePartialRendering="true"

won't let me fire the paging, deleting etc. events

Do you have it set to true?


hello.

yes i have. i've introduced < in my previous post and i think that now you should be able to see everything.

Paging in GridView gets Object Expected Error

I have a grid in an update panel that gets databound at runtime (to index server results). I have implemented paging and it works without atlas. As soon as I place that grid in update panel, paging stops working. All I get is a javascript error saying "line 1 :Object Requiered".

I have tried debugging it but on paging, it doesn't event get to the server.

thanks

Hi Biren,

Have you tried this with the April CTP of Atlas that was released earlier this week?

If it's still a problem, can you please provide some more details on your scenario so that we can investigate?

Thanks,

Eilon


I have done it and it works for me. Object required is a pretty generic error just as the "Object reference not set to an..." in .Net. It could be because of wrong syntax in javascript or html that you might have on the page.

If you don't mind pasting the code on the forum please do so we can look at it.


Just tried it and same error.

here is the code:

<%@. Page Language="VB" AutoEventWireup="false" CodeFile="Index.aspx.vb" Inherits="Index" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head id="Head1" runat="server">
<title>Search</title>
<link href="http://links.10026.com/?link=Style.css" rel="stylesheet" type="text/css" />
</head>
<body>
<atlas:ScriptManager EnablePartialRendering="true" ID="atlas1" runat="server" EnableViewState="true" />
<form id="frm1" runat="server">

<atlas:UpdateProgress ID="up11" runat="server" >
<ProgressTemplate >
<table>
<tr>
<th style="color:red">Please wait while your serach results are calculated...</th>
</tr>
<tr>
<td>
<img src="http://pics.10026.com/?src=images/spinner.gif" /></td>
</tr>
</table>

</ProgressTemplate>
</atlas:UpdateProgress>
<atlas:UpdatePanel ID="up1" Mode="conditional" runat="server" >
<ContentTemplate >



<table>
<tr>
<th>A word or phrase in the file: </th><td><asp:TextBox ID="txtsearch" runat="server" /></td>
</tr>
<tr>
<th>All or part of filename: </th><td><asp:TextBox ID="txtfilename" runat="server" /></td>
</tr>
<tr>
<th>When was it modified?:</th>
<td>
<asp:DropDownList ID="lstDuration" runat="server">
<asp:ListItem Text="Don't remember" Value="0" />
<asp:ListItem Text="Within the last week" Value="7" />
<asp:ListItem Text="Past Month" Value="30" />
<asp:ListItem Text="Within the past year" Value="365" />
</asp:DropDownList>
</td>
</tr>
<tr>
<td colspan="2"><asp:Button ID="btnSubmit" runat="server" Text="Search" /></td>
</tr>
</table>

<asp:GridView ID="grdResults" runat="server" CellPadding="4" ForeColor="#333333"
GridLines="None" AllowSorting="True" AllowPaging="True" PageSize="2" AutoGenerateColumns="False">
<Columns>
<asp:TemplateField HeaderText="Document Information">
<ItemTemplate>
<p>
<a href="http://links.10026.com/?link=<%# DataBinder.Eval(Container, "DataItem.path")%>">
<%# DataBinder.Eval(Container, "DataItem.Path")%>
</a>
<br />
<i>Last modified:
<%# DataBinder.Eval(Container, "DataItem.Write")%>
</i>
<br />
</p>
</ItemTemplate>
</asp:TemplateField>
</Columns>
<FooterStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<RowStyle BackColor="#F7F6F3" ForeColor="#333333" />
<EditRowStyle BackColor="#999999" />
<SelectedRowStyle BackColor="#E2DED6" Font-Bold="True" ForeColor="#333333" />
<PagerStyle BackColor="#284775" ForeColor="White" HorizontalAlign="Center" />
<HeaderStyle BackColor="#5D7B9D" Font-Bold="True" ForeColor="White" />
<AlternatingRowStyle BackColor="White" ForeColor="#284775" />
</asp:GridView>

</ContentTemplate>

</atlas:UpdatePanel>
</form>
</body>
</html>

Code behind:

Partial Class Index
Inherits System.Web.UI.Page

Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click


' Bind DataGrid to the DataSet. DataGrid is the ID for the
' DataGrid control in the HTML section.
Dim source As New DataView(createDS.Tables(0))
grdResults.DataSource = source
grdResults.DataBind()

End Sub
Private Function createDS() As DataSet
Dim cnnOledb As New OleDb.OleDbConnection
Dim strQuery As String

Dim critstr As String = "(contains(filename,'.doc OR .xls OR .ppt OR .asp OR .aspx OR .txt'))"

If txtsearch.Text.Length <> 0 Then
critstr += " AND (contains(contents,'" + condition(txtsearch.Text) + "'))"
End If


strQuery = "Select DocTitle,Filename,VPath,Rank,Characterization,Write,path from SCOPE() where " + critstr + " order by write desc"

Dim connString As String = "Provider=MSIDXS;Data Source='o drive'"

Dim cn As New System.Data.OleDb.OleDbConnection(connString)
Dim cmd As New System.Data.OleDb.OleDbDataAdapter(strQuery, cn)
Dim objDS As New DataSet

cmd.Fill(objDS)

Return objDS
End Function

Function condition(ByVal srchstr As String) As String
Dim arr As String() = srchstr.Split(" ")
For i As Integer = 0 To arr.Length - 1
Dim str1 As String = arr(i)
If str1 <> "AND" And str1 <> "OR" And str1 <> "NOT" Then
arr(i) = "\" + str1 + "\"
End If
Next
Return String.Join(" AND ", arr)
End Function


Sub grdResults_PageIndexChanging(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.GridViewPageEventArgs) Handles grdResults.PageIndexChanging
grdResults.PageIndex = e.NewPageIndex
Dim source As New DataView(createDS.Tables(0))
grdResults.DataSource = source
grdResults.DataBind()

End Sub
End Class


Hi again,

I tried this out and I'm getting the same error. This turns out to be a known bug in the April CTP of Atlas. To work around it, add this code to your Page's Load event handler:

Page.ClientScript.GetPostBackEventReference(this, String.Empty);

Thanks,

Eilon


that works. Thank you. btw ATLAS ROCKS!!

Appears to be an issue in the June CTP too... and if it wasn't for this post, I'd still have the issue.

Thanks guys


Correct, this was not fixed in the June CTP. For now the one line workaround should still be sufficient.

Thanks,

Eilon


In the case of nested UserControls, does this workaround apply? If so, where should the workaround go?

I have a page which contains a UserControl, which in turn contains another UserControl, which contains a GridView wrapped in an UpdatePanel. I tried adding this line to the page's Page_Load and the UserControl's Page_Load, but I get the same generic error:

Line: 10846
Char: 17
Error: Object required
FYI, the offending line appears to be the second one pasted below:

function destroyTree(element, markupContext) {

if (element.nodeType == 1) {


Any ideas?

slp004, can you please give more details as to what you're trying to do? It sounds like other people on this thread have this scenario working so I'm curious what's going on here.

Thanks,
Eilon


I was never able to figure out exactly what the problem was, but by breaking the page up into a number of smaller pages sharing a single master page it started working again. There were just way too many UserControls inside GridView inside FormView inside UserControls inside View areas inside show/hide panels... you get the idea.

I have exactly the same problem - in the same line

 function destroyTree(element, markupContext) {if (element.nodeType == 1) {

My page have three or four levels of nested user controls inside the update panel. The curious thing is the page with the same controls has worked before some change I did - now I am trying to figure it out.


Wow, I figured out the issue.

The error was caused because I have another updatepanel in this page - inside a user control, included in master page. The user control has Visible=false. This scenario causes the error. When I set the user control visibility to true, the error goes off.

The solution is setting the updatepanel (that is inside the user control) mode to Conditional. This solves the problem even if the user control is invisible.

HTH.


I had the same problem and I set all the update panels to conditional and it worked.

Paging(GridView) Inside update Panel

When I enable Paging for a GridView inside a Update Panel for Jan. CTP I get a JavaScript error when I try to page. Is there a work around for this?

Thanks!

Things are working fine with me. I dont know what's the problem in your project.

A.

PagingBulletedListExtender not working anymore

After Beta 2 installation PagingBulletedListExtender is not working anymore, just creates one long bulleted list. And more, notorious error 'SYS is undefined'. All changes suggested in the migration to Beta2 guide done.

"Sys is undefined" almost always means ASP.NET AJAX isn't installed correctly. If the following from its release notes doesn't help, please follow up in one of the other ASP.NET AJAX forums:

* A new ScriptResource handler has been added that requires the following entry in the Web.config
file:

<add verb="GET"
path="ScriptResource.axd"
type="Microsoft.Web.Handlers.ScriptResourceHandler"
validate="false"/>

This handler requires an entry in the Web.config file. If the entry is missing, you might see the
following error:

'Sys' is undefined.


ScriptResource handler was added to web.config
Please reply with acomplete, simple, self-contained sample page that demonstrates the problem so that we can investigate the specific behavior you're seeing. Thank you!

<%@. Page Language="VB" AutoEventWireup="true" CodeFile="Default.aspx.vb" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Paging Bulleted List</title>
<link href="http://links.10026.com/?link=StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>

<ajaxToolkit:PagingBulletedListExtender ID="PBLE1" runat="server"
TargetControlID="BulletedList1"
ClientSort="true"
IndexSize="1"
Separator=" - "
SelectIndexCssClass="selectIndex"
UnselectIndexCssClass="unSelectIndex" />

<asp:BulletedList ID="BulletedList1" runat="server" DisplayMode="Text" DataSourceID="mySqlDataSource" DataTextField="CompanyName" DataValueField="CustomerId">
<asp:ListItem>Blur</asp:ListItem>
<asp:ListItem>Brand</asp:ListItem>
<asp:ListItem>Color</asp:ListItem>
</asp:BulletedList>

<asp:SqlDataSource ID="mySqlDataSource" runat="server" EnableCaching="true"
ConnectionString="<%$ ConnectionStrings:NorthWindConnectionString %>"
SelectCommand="SELECT CustomerId, CompanyName FROM customers" >
</asp:SqlDataSource>

</div>


</form>
</body>
</html>

=================

Web.Config :

...

<handlers>
<remove name="WebServiceHandlerFactory-ISAPI-2.0"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="Microsoft.Web.Script.Services.ScriptHandlerFactory, Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>
<add name="ScriptResource" verb="GET" path="ScriptResource.axd" type="Microsoft.Web.Handlers.ScriptResourceHandler" validate="false"/>
</handlers>
...


I removed the SQL and code-behind dependencies from the sample above and tried it in the SampleWebSite directory of the 61126 Toolkit where it appears to work fine to me:

<%@. Page Language="VB" AutoEventWireup="true" %><%@. Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajaxToolkit" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head id="Head1" runat="server"> <title>Paging Bulleted List</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="ScriptManager1" runat="server" /> <div> <ajaxToolkit:PagingBulletedListExtender ID="PBLE1" runat="server" TargetControlID="BulletedList1" ClientSort="true" IndexSize="1" Separator=" - " SelectIndexCssClass="selectIndex" UnselectIndexCssClass="unSelectIndex" /> <asp:BulletedList ID="BulletedList1" runat="server" DisplayMode="Text"> <asp:ListItem>Blur</asp:ListItem> <asp:ListItem>Brand</asp:ListItem> <asp:ListItem>Color</asp:ListItem> </asp:BulletedList> </div> </form></body></html>

Yes, it works. The problem was in my Web.config

I added before ScriptResource to the handlers of the section system.webServer, and now I added this ScriptResource to the httpHandlers of the system.web section.

Now it works perfect. Thank you.