Showing posts with label bug. Show all posts
Showing posts with label bug. Show all posts

Monday, March 26, 2012

ASP.NET AJAX Beta 2 Bug

I have a popup window in a web project that on postback executes the following startup JavaScript:

window.opener.document.getElementById('rptrOtherCrit_ctl01_PTSValList1_hdnValues').value ='NJ';window.opener.__doPostBack('rptrOtherCrit$ctl01$PTSValList1$hdnValues','')window.opener.focus();window.close();

The hidden control in the opening page that is being modified is within an <asp:UpdatePanel> control. Everything works fine when using IE 6 but, when using Firefox 2.0 the following error appears in the Error Console:

Error: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: http://localhost/TaxBrowser/ScriptResource.axd?d=rrMPh95m1EXHDVTP53sdlY7yEQVgCg7PqciEiGs1HCx_e6TnjvyveNwrB2X38b1_rlFCHP1MhbU0L_WYwgrZDpG_PF1uwTqLpZqVE5wb1XLd2paC8td9zt_W4KlqoZhrtCCwf7Z_N-6whUkZJdtjEe1ZeMEM-Pqb3wvBBXghujU1&t=633008283654152282 :: Sys$Net$XMLHttpExecutor$get_statusCode :: line 3509" data: no]
Source File: http://localhost/TaxBrowser/ScriptResource.axd?d=rrMPh95m1EXHDVTP53sdlY7yEQVgCg7PqciEiGs1HCx_e6TnjvyveNwrB2X38b1_rlFCHP1MhbU0L_WYwgrZDpG_PF1uwTqLpZqVE5wb1XLd2paC8td9zt_W4KlqoZhrtCCwf7Z_N-6whUkZJdtjEe1ZeMEM-Pqb3wvBBXghujU1&t=633008283654152282
Line: 3509


Certainly looks like a bug to me.

Try to test?it?in?IE?7.0,Opera,Escape?or?Safari?and?check?if?it?gets?the?same?error.Maybe?the?error?message?is?caused?by?
FireFox, not?Ajax?bug. Besides,can you post some codes here?This maybe?gives?us?to?fix?the?problem.
Try?to?debug?your?codes?and?fix?which?code?lines?cause?the?error?message.

I'm getting the same error (in firefox) just trying the sample at:

http://ajax.asp.net/docs/ViewSample.aspx?sref=Sys.Net.PageMethod%23PageMethod.aspx but not in IE 6. I'll try updating firefox


You need to add "[Microsoft.Web.Script.Services.ScriptService]" in front of the web service class in Ajax Beta 2.It is said this is a known bug in Ajax Beta 2.Try to add it and test your codes in IE,FireFox,Opera and Safari.Please let me know the testing results.

ASP.NET AJAX and urlMapping bug

A page will error out with "Sys.WebForms.PageRequestManagerServerErrorException: An unkown error occurred while processing the request on the server. The status code returned from the server was: 12031" when an update panel is updating for the second update. In other words, the first AJAX-style page update works fine, but the second one causes this error.

I've narrowed down the problem to urlMappings in the web.config file. I'm using it to control role-based access. When the page name doesn't match the source page name, the error occurs. For example, this works:

<urlMappings>
<add url="~/folder/Default2.aspx" mappedUrl="~/Default2.aspx"/>
</urlMappings>

While this doesn't:

<urlMappings>
<add url="~/folder/edit.aspx" mappedUrl="~/Default2.aspx"/>
</urlMappings>

Here's a project showing an example of the error in action. Master page:

<%@dotnet.itags.org. Master Language="VB" CodeFile="MasterPage.master.vb" Inherits="MasterPage" %><!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 runat="server">
<title>Untitled Page</title>
<link href="StyleSheet.css" rel="stylesheet" type="text/css" />
</head>
<body>
<form id="form1" runat="server">
<div>
<ajax:ScriptManager runat="server" ID="SM1" />
<div class="header">
Sweet header text.
</div>
<asp:HyperLink runat="server" ID="HL1" NavigateUrl="~/folder/edit.aspx" Text="Page doesn't really exist!" /><br />
<asp:HyperLink runat="server" ID="HL2" NavigateUrl="~/Default.aspx" Text="Default page." /><br />
<b>Content begins:<br /></b><br /><br />
<ajax:UpdatePanel runat="server" ID="upanel1">
<ContentTemplate>
<asp:contentplaceholder id="ContentPlaceHolder1" runat="server" />
</ContentTemplate>
</ajax:UpdatePanel>
<br /><b>Content ended.</b><br /><br /
</div>
</form>
</body>
</html>

Default.aspx:

<%@dotnet.itags.org. Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" title="Untitled Page" %><asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
This page is ~/Default.aspx.
</asp:Content>

Default2.aspx:

<%@dotnet.itags.org. Page Language="VB" MasterPageFile="~/MasterPage.master" AutoEventWireup="false" CodeFile="Default2.aspx.vb" Inherits="Default2" title="Untitled Page" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
This page is ~/Default2.aspx.<br />
<asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="true">
<asp:ListItem Text="Show label one" Value="1" />
<asp:ListItem Text="Show label two" Value="2" />
</asp:DropDownList>
<br />
<asp:Label ID="Label1" runat="server" Text="Label one" Visible="false" />
<asp:Label ID="Label2" runat="server" Text="Label two" Visible="false" />
</asp:Content>

Default2.aspx.vb:

PartialClass Default2
Inherits System.Web.UI.Page

Protected Sub DropDownList1_SelectedIndexChanged(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles DropDownList1.SelectedIndexChanged
If DropDownList1.SelectedValue ="1"Then Label1.Visible =True Label2.Visible =False
Else Label1.Visible =False Label2.Visible =True
End If
End Sub
End Class

Make a folder called "folder" in the root of the project and add this to the web.config, under system.web:

<urlMappings>
<add url="~/folder/edit.aspx" mappedUrl="~/Default2.aspx"/>
</urlMappings>

To see the bug, fire up the project and click the "Page doesn't really exist" link. This will bring you to the mapped page. Change the dropdownlist's selection, notice the label change, then change the selection on the DDL again. You'll get the error I specified earlier. Fiddler shows the AJAX call attempting to read folder/Default2.aspx instead of the correct URL, causing a 404 and the callback to fail.

Any idea for a fix on this one? It can be worked around by keeping the page names consistent, but that doesn't fix the bug.

Did you ever find a solution to this. My setup is not the same, but I am getting the same error.

Saturday, March 24, 2012

ASP.NET 2.0 Wizard in Update Panel BUG

Hi all,

I have a Wizard control within an Update Panel. This used to work fine in Atlas but now that I upgraded to the ASP.NET Ajax release, I've discovered a bug.

When you go through the wizard, clicking the next button to go from step 1 to step 2 works fine. When you click the next button to go from step 2 to step 3, nothing happens and there is a javascript error -'null' is null or not an object. This same bug occurs under the same scenario in a MultiView, even if the next buttons are outside of the MultiView.

This seems to have something to do with ajax choking on the ASP.NET client-side validation, as you can set CausesValidation="false" on the next buttons and then you can go on to step 3. However, this isn't much of a solution, as I want to have client-side validation and not just the Page.Validate() / if(Page.IsValid) server-side code.

Anyone know a way around this bug or if it is being fixed in an upcoming release?

Thanks,

Justin

It appears it had nothing to do with the wizard and everything to do with the asp.net validator controls not working correctly in the current release of asp.net ajax 1.0.

The answer until they fix this is:

http://blogs.msdn.com/mattgi/archive/2007/01/23/asp-net-ajax-validators.aspx