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

Wednesday, March 28, 2012

Accessing Master page control from child page

Hi,

In my application I have implemented a customized error control, which gets visible on any error raised.

Issue is, in one of the page where we have implemnted Update Panel, and onClick of a button I wants to raise a error on the control in Master page.

The Page object has a Master property that will reference the properties of the master page. Note that you will need to apply the MasterType directive to your page or use the Page.MasterPageFile property to reference the master page properties.

hi,

You can retrieve the master page controls by using this.masterPage property.

Hope this helps


Hi,

In all my other pages I am able to access the properties of master page, but not able to access the property for the page where Update panel is implemented.


hello.

in my opinion, this is what you should do:

1. create an interface which has the properties/methods you want to access.

2. change the master so that it implements the interface. if you want to get a property from q control, don't forget to call ensurechildcontrols() beforeaccessing the control on the property code

3. on your page, start by getting a reference to the master and see if it implements the required interface. if it does, then just cast the master reference to the interface and use it to access the properties/methods you need.

Accessing DropDownList in UpdatePanel programmatically

I have an updatepanel within and updatepanel and am trying to access a drop down list as shown below. I am receiving an error saying the object is not set.

Dim LOAN_TYPEAs DropDownList =New DropDownList

LOAN_TYPE = UpdatePanel1.FindControl("UpdatePanel2").FindControl("ddlSIM_TYPE")

If LOAN_TYPE.SelectedValue ="Std"Then 'THIS IS WHERE I RECEIVE MY ERROR

Any ideas?

Try:

Dim LOAN_TYPEAs DropDownList = CType(UpdatePanel1.FindControl("UpdatePanel2").FindControl("ddlSIM_TYPE") , DropDownList)

-Damien


I tried that as well and same message. This is driving me nuts...

Any other ideas? Thanks for your help!


Use UpdatePanel.ContentTemplateContainer.FindControl(), instead.


You are going to hate me but that resulted in the same error message.

UpdatePanel1.ContentTemplateContainer.FindControl("UpdatePanel2").FindControl("ddlSIM_TYPE")


You need to use it on both UpdatePanels. In C#, it would work like this:

UpdatePanel up2 = (UpdatePanel)UpdatePanel1.ContentTemplateContainer.FindControl("UpdatePanel2");
DropDownList ddl = (DropDownList)up2.ContentTemplateContainer.FindControl("ddlSIM_TYPE");

I'm not sure of the exact VB syntax, but hopefully that makes sense.

Though, unless UpdatePanel2 is dynamically generated, you ought to be able to just find the dropdown like this:

DropDownList ddl = (DropDownList)UpdatePanel2.ContentTemplate.FindControl("ddlSIM_TYPE");

Ok, tried that and no luck. Here is the code section:

Dim p2As UpdatePanel = UpdatePanel1.ContentTemplateContainer.FindControl("UpdatePanel2")

Dim PVAs TextBox = p2.ContentTemplateContainer.FindControl("txtSIM_PV")

Dim IAs TextBox = p2.ContentTemplateContainer.FindControl("txtSIM_I")

Dim NAs TextBox = p2.ContentTemplateContainer.FindControl("txtSIM_N")

Dim LOAN_TYPEAs DropDownList = p2.ContentTemplateContainer.FindControl("ddlSIM_TYPE")

If LOAN_TYPE.SelectedValue ="Std"Then

When accessing this if statement i get an object not set error when accessing any of the objects shown above. I have checked and double checked everything and no luck. its inside the Form tag, it has runat=server, etc. Any other ideas - I am at my wits end...

Thanks


Well on the bright side, if you're not getting the error until the conditional, that means the UpdatePanel2 find is working.

Inside UpdatePanel2, are your TextBox and DropDownList controls contained within another control, like a panel or a wizard or a repeater?


Hi,

I agree withgt1329a.

But seeSolution to the FindControl problem for more information about FindControl problem.

Best Regards,

Monday, March 26, 2012

Accessing a WebService-Method

Hello, i was migrating from Atlas July-CTP to Beta 2.

Now get an error when i call my webservice from javascript and the message is talking about System.InvalidOepration and authentication failed,

but only when I mark the corresponding method with EnableSession= true. In Atals JulyCTP the same call worked fine. Is there maybe a change in security-model?

Did I forget something or a declarartion is not set right?

Can anybody explain?

Hallo Michael,

can you show us the code of youre WebService definition?

Servus
Klaus


Check to see if your Web service definition has the ScriptService attribute (http://ajax.asp.net/docs/mref/8bb8cdde-6050-e492-e72a-eed2242c213c.aspx).
I believe the CTP version didn't have this attribute.


using System;

using System.IO;

using System.Web;

using System.Collections;

using System.Collections.Generic;

using System.Threading;

using System.Web.Services;

using System.Web.Services.Protocols;

using System.Xml.Serialization;

using System.Web.UI.WebControls;

using Microsoft.Web.Script.Services;

[ScriptService]

[WebService(Namespace ="http://tempuri.org/")]

[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]

publicclass VehicleDataService : System.Web.Services.WebService

{

This Method is accessible, because it's called from Ajax:AutoCompleteExtender

[WebMethod(EnableSession =true)]

publicstring[] GetColors(string prefixText,int count)

{

string[] autoCompleteColors =null;

//Ablauf analog zu oben lediglich für Color statt für Model/Manufacturer

User user = SessionData.User;

if (autoCompleteColors ==null)

{

autoCompleteColors = VehicleDataUtils.GetColorsAsStringList(user);

}

int index =Array.BinarySearch(

autoCompleteColors, prefixText,

newCaseInsensitiveComparer());

if (index <0)

{

index = ~index;

}

int matchingCount;

for (matchingCount =0; matchingCount < count

&& index + matchingCount < autoCompleteColors.Length; matchingCount++)

{

if (!autoCompleteColors[index + matchingCount].StartsWith(

prefixText,StringComparison.CurrentCultureIgnoreCase))

{

break;

}

}

String[] returnValue =newstring[matchingCount];

if (matchingCount >0)

{

Array.Copy(autoCompleteColors, index, returnValue,0, matchingCount);

}

return returnValue;

}

This method is'nt accessible, it's called from pure javascript in a javascript-source file.

///<summary>

/// Setzt den aktuellen Hersteller (Name)

///</summary>

///<param name="input">Name des Herstellers</param>

[ScriptMethod]

[WebMethod(EnableSession =true)]

publicvoid SetActualManufacturer(string input)

{

SessionData.VehiclePageManufacturer = input;

}

}


Hello Michael,

maybe i'm wrong, but for me is VOID in a webservice a "not so god idee". You get absolut no response from this methode. It's not better to create an object with a returnvalue and react to the returnvalue?

It's only a idee.


The web service code seems OK. I don't know exactly how you're invoking the web service.
As you described, probably you don't have an aspx page with service reference configured using this web service. Adding a service reference to your page, makes AJAX download or include in the web page the proxy code (depending on the parameters you provide).
Check the proxy code that your service generates and see if it helps you (you can check that looking athttp://yourserverver/yourService.asmx/js - you just include /js after your web service address).

HTH,

Maíra

Access Method

Hello,

I am defining and adding a AutoCompleteExtender to a page at runtime but I am getting an error when defining:

MyAutoComplete.ServiceMethod ="GetCompletionList"

The "GetCompletionList" is a method inside the AutoComplete.asmx file.

What do I need to do so it become available?

Thanks,

Miguel

Miguel,

Where does the ASMX file reside? Do you have it referenced in your script manager section?

Please post your code. It should help narrow down the issue.

Tim


Hello,

I just added the asmx file using the VS menu so the .asmx file was placed on the root of my web site and the correspondent .vb file was placed in App_Code.

Is this what I should do?

Then I also added the following code line on MyPage.vb Init event:

MyScriptManager.Services.Add(New ServiceReference("AutoComplete.asmx"))

Thanks,

Miguel


Hi Miguel,

You need to specify the service path as well.

MyAutoComplete.ServicePath="AutoCompleteExtender.asmx" 

Access Denied javascript error - Urgent help required

Hi there,

I'm tearing my hair out here, i'm using the ModalPopupExtender and it's returning a javascript error "Access is denied"

It works perfectly on my machine locally but when uploaded to our production server it returns this error.

I know what you're thinking, it's cross-domain issue or iframes. However we don't use either!!!! I've searching the internet high and low to no avail.

I've even tried using scriptpath instead and that doesn't work either, get js error 'ajaxcontrolkit is undefined'

I'm going to have to scrap a lot of work if i can't get a solution for this.

Please, please help!

Thanks in advance

Rob

Have you identified the offending line with a debugger?


Hi David, It's a javascript error, simply one that is displayed by Internet Explorer 7, Line No. 5960Char: 49Error: Access is deniedCode: 0URL: xxxAny ideas?

A debugger like Firebug (for Firefox) will let you set a breakpoint there and see what the problem might be.

Access Denied error when attempting to consume web service

I am attempting to call a web service from my extender control, but when I do so, I get an error message - access denied (there are no other details). After some research, I think this has something to do with cross site scripting - since the web service exists elsewhere (it is a public webservice). How does one access an external webservice?

Here is the code that is throwing the error:

Sys.Net.WebServiceProxy.invoke(this.get_servicePath(),this.get_serviceMethod(),false, params,

Function.createDelegate(this,this._onMethodComplete),

Function.createDelegate(this,this._onMethodFailed));

ServicePath="http://www.webservicex.net/uszip.asmx"ServiceMethod="GetInfoByZIP"

Check out this article:

http://dotnetslackers.com/columns/ajax/MashitUpwithASPNETAJAX.aspx

Hope this helps,

Elias.

Access denied Error

HI,

I am getting an Access denied error, if I use AJAX in ASPX page..

intially I got Javascript window ( Do you wish to debug..) When I said 'Yes' it showed me the code below..

//------------------
// Copyright (C) Microsoft Corporation. All rights reserved.
//------------------
// MicrosoftAjax.js
Function.__typeName="Function";Function.__class=true;Function.createCallback=..................
........................
g=e.screenLeft-top.screenLeft-top.document.documentElement.scrollLeft+2 ------ its showing error at this point..

What is the solution for this?

Thanks


Try to disable the javascript debugging. See what happens then

Configure AJAX properly

http://www.asp.net/AJAX/Documentation/Live/ConfiguringASPNETAJAX.aspx


Hiasppick,

Please refer to these entries:

http://blogs.msdn.com/delay/archive/2007/02/05/safely-avoiding-the-access-denied-dialog-how-to-work-around-the-access-denied-cross-domain-iframe-issue-in-the-ajax-control-toolkit.aspx

http://weblogs.asp.net/bleroy/archive/2007/01/31/how-to-work-around-the-quot-access-denied-quot-cross-domain-frame-issue-in-asp-net-ajax-1-0.aspx

Hope this helps.

Access controls added dinamically?

Hi:
I trying to access to controls in updatepanel that I createddinamically before with atlas too, and I allways get the error that thecontrol does not exist.
Is there any way to do this?
Thanks so much.Do you have some sample source you can post? In which event handler are you trying to access the controls?
I was tried this with the code in the examples section. With SimpleList1_edit.aspx exactly.
I add a new textbox and a new button to panel3 when I click button ,and it works perfect, but when I click the new button and go to thecode for the code onclick then the findcontrol never finds the controlin the panel. I tried with find in the whole page and only in the panel and never works. This is the code:

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

<%@. Import Namespace="System.Data" %>
<%@. Import Namespace="System.Data.SqlClient" %>

<script runat="server">

protected void Page_Load(object sender, EventArgs e)
{
TimerMessage.Text = DateTime.Now.ToLongTimeString();
if (!IsPostBack)
{
ViewState["CurrentTab"] = "0";
}
}


protected void AddnewBtn_click2(object sender, EventArgs e)
{
TextBox txtbox = (TextBox)FindControl("newtxtbox");
idlbl.Text = txtbox.Text;
panel3.Update();
}
protected void AddnewBtn_click(object sender, EventArgs e)
{


TextBox txtbox = new TextBox();
txtbox.ID = "newtxtbox";
Button btn = new Button();
btn.ID = "newbtn";
btn.OnClientClick = "AddnewBtn_click2";
panel3.Controls.Add(txtbox);
panel3.Controls.Add(btn);
btn.Text = "Read new textbox value";
panel3.Update();

}
protected string FormatPriority(int priority)
{
switch (priority)
{
case 1:
return "Low";
case 2:
return "Medium";
default:
return "High";
}
}

protected string FormatDone(bool isDone)
{
return isDone == true ? "Yes" : "No";
}

protected void Done_CheckedChanged(object sender, EventArgs e)
{
CheckBox cbx = (CheckBox)sender;
GridViewRow row = (GridViewRow)cbx.NamingContainer;
using (SqlConnection cn =newSqlConnection(ConfigurationManager.ConnectionStrings["SimpleListsConnectionString"].ConnectionString))
{
cn.Open();
SqlCommand cmd = new SqlCommand(
"UPDATE Lists SET IsComplete = @.IsComplete WHERE ListId = @.ListId",cn);
cmd.Parameters.Add("IsComplete", cbx.Checked);
cmd.Parameters.Add("ListId", ListGrid.DataKeys[row.RowIndex].Value);
cmd.ExecuteNonQuery();
}
ListGrid.DataBind();
}

protected void Select_Command(object sender, CommandEventArgs e)
{
ListDataSource.SelectParameters["IsComplete"].DefaultValue =
e.CommandArgument.ToString();
if (e.CommandName == "show")
SearchText.Text = "";
ViewState["CurrentTab"] = e.CommandArgument;
panel2.Update();
}

protected void Page_PreRender(object sender, EventArgs e)
{
int i = int.Parse(ViewState["CurrentTab"].ToString());
ActiveButton.CssClass = i == 0 ? "activeTab" : "tab";
CompletedButton.CssClass = i == 1 ? "activeTab" : "tab";
AllButton.CssClass = i == -1 ? "activeTab" : "tab";
SearchTab.Attributes["class"] = i == -2 ? "activeTab" : "tab";
}
protected void Page_ErrorHandler(object sender, PageErrorEventArgs e)
{
e.ErrorMessage = "Exception at " + DateTime.Now.ToString() +
"; Error Message: " + e.Error.Message;
}

</script>

<!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">
<link href="http://links.10026.com/?link=StyleSheet.css" rel="stylesheet" type="text/css" />
<title>Partial Rendering</title>


</head>
<body>
<form id="f1" runat="server">
<atlas:ScriptManagerID="ScriptManager1" EnablePartialRendering="true"OnPageError="Page_ErrorHandler" runat="server">
<ErrorTemplate>
<div style="width: 450px; height: 300px; padding: 10px; border:solid 3px black; background: #ffd; text-align: left;">
<h1>Server Error</h1>
<p>An unhandled exception with the following message has occuredon the server:</p>
<p><span id="errorMessageLabel"runat="server"></span></p>
<p><input id="okButton" type="button" value="OK"runat="server"/></p>
</div>
</ErrorTemplate>
</atlas:ScriptManager>
<atlas:UpdateProgress runat="server" id="updateProgress1">
<ProgressTemplate>
<div style="width: 450px; height:300px;position:absolute; padding: 10px; border: solid 3px black;background: #ffd; text-align: left;">
<img src="http://pics.10026.com/?src=Progress.gif" /> Contacting Server...
<button id="abortButton">Stop</button>
</div>
</ProgressTemplate>
</atlas:UpdateProgress>
<div>
<div id="top">

</div>
<div class="ContentContainer">
<div id="header">
<div id="ServerMessage">
<span class="controlLabel">Server Time:</span>
<asp:Label ID="TimerMessage" runat="server">n/a</asp:Label><asp:Button ID="UpdateTimerMessageBtn" Text="Update" runat="server"/>
</div>
<span class="title"><a href="http://links.10026.com/?link=Default.aspx">SimpleList</a> > Standard Server Page</span>
</div>
<div class="tabs">

<atlas:UpdatePanel ID="panel1" runat="serveR" Mode="Conditional">
<ContentTemplate>
<span class="controlLabel">Show:</span>
<asp:LinkButton ID="ActiveButton" Text="Active" CommandName="show"CommandArgument="0" OnCommand="Select_Command" runat="server" />
<asp:LinkButton ID="CompletedButton" Text="Completed"CommandName="show" CommandArgument="1" OnCommand="Select_Command"runat="server" />
<asp:LinkButton ID="AllButton" Text="All" CommandName="show"CommandArgument="-1" OnCommand="Select_Command" runat="server" />
<span class="controlLabel leftSpace">Search:</span>
<span id="SearchTab" runat="server">
<asp:TextBox ID="SearchText" CssClass="filterdropdown" Width="150px"runat="server" />
<asp:Button ID="SearchBtn" CssClass="topButtons" Text=" >> "
CommandName="search" CommandArgument="-2" OnCommand="Select_Command"runat="server" />
</span>
</ContentTemplate>
</atlas:UpdatePanel>
<!-- Add a closing UpdatePanel tag below here. -->
</div>
<div id="list">

<atlas:UpdatePanel ID="panel2" runat="server" Mode="Conditional">
<ContentTemplate>
<asp:GridView ID="ListGrid" BorderWidth="0px"AutoGenerateColumns="False" DataKeyNames="ListId"
DataSourceID="ListDataSource" AllowPaging="True" AllowSorting="True"EnableViewState="False"
GridLines="None" runat="server">
<Columns>
<asp:TemplateField ShowHeader="False">
<EditItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server"CausesValidation="True" CommandName="Update"
Text="Update"></asp:LinkButton>
<asp:LinkButton ID="LinkButton2" runat="server"CausesValidation="False" CommandName="Cancel"
Text="Cancel"></asp:LinkButton>
</EditItemTemplate>
<ItemTemplate>
<asp:LinkButton ID="LinkButton1" runat="server"CausesValidation="False" CommandName="Edit"
Text="Edit"></asp:LinkButton>
<asp:LinkButton ID="DeleteBtn" runat="server"CausesValidation="False" CommandName="Delete"
Text="Delete"></asp:LinkButton>
</ItemTemplate>
<ControlStyle CssClass="buttons" />
<HeaderStyle CssClass="commands" />
</asp:TemplateField>
<asp:BoundField DataField="Name" HeaderText="List"SortExpression="Name">
<ControlStyle CssClass="name_edit" />
<ItemStyle CssClass="name" />
<HeaderStyle CssClass="name" />
</asp:BoundField>
<asp:TemplateField HeaderText="Priority"SortExpression="Priority">
<EditItemTemplate>
<asp:DropDownList ID="DropDownList1" Width="75"SelectedValue='<%# Bind("Priority") %>'
runat="server">
<asp:ListItem Text="High" Value="3" />
<asp:ListItem Text="Medium" Value="2" />
<asp:ListItem Text="Low" Value="1" />
</asp:DropDownList>
</EditItemTemplate>
<ItemTemplate>
<asp:Label ID="pri" Text='<%# FormatPriority((int)Eval("Priority")) %>' runat="server" />
</ItemTemplate>
<ItemStyle CssClass="priority" />
<HeaderStyle CssClass="priority" />
</asp:TemplateField>
<asp:BoundField DataField="DateCreated"DataFormatString="{0:MM/dd/yyyy}" HtmlEncode="False"
HeaderText="Started" ReadOnly="True" SortExpression="DateCreated">
<ItemStyle CssClass="started" />
<HeaderStyle CssClass="started" />
</asp:BoundField>
<asp:TemplateField HeaderText="Completed"SortExpression="IsComplete">
<EditItemTemplate>
<asp:CheckBox ID="CheckBox1" runat="server" Checked='<%#Bind("IsComplete") %>' />
</EditItemTemplate>
<ItemStyle CssClass="iscomplete" />
<HeaderStyle CssClass="iscomplete" />
<ItemTemplate>
<asp:Label ID="Done" Text='<%# FormatDone((bool)Eval("IsComplete")) %>' runat="server" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
<EmptyDataTemplate>
<span id="Empty">No lists</span>
</EmptyDataTemplate>
</asp:GridView>
</ContentTemplate>
<Triggers>
<atlas:ControlEventTrigger ControlID="AddListBtn" EventName="Click"/>
</Triggers>
</atlas:UpdatePanel>
<!-- Add a closing UpdatePanel tag below here. -->
</div>
<div id="AddNew">

<atlas:UpdatePanel ID="panel3" Mode="Conditional" runat="server">
<ContentTemplate>
<span>Add New List:</span>
<asp:TextBox ID="AddItemTxt" CssClass="newitem"runat="server"></asp:TextBox>
<asp:Button ID="AddnewBtn" runat="server" OnClick="AddnewBtn_Click"Text="Add" />
</ContentTemplate>
<Triggers>
<atlas:ControlEventTrigger ControlID="AddnewBtn" EventName="Click"/>
</Triggers>
</atlas:UpdatePanel>

</div>


</div>
</div>

<asp:SqlDataSourceID="ListDataSource" runat="server" ConnectionString="<%$ConnectionStrings:SimpleListsConnectionString %>"
SelectCommand="SELECT ListId, Name, Priority, IsComplete, DateCreated
FROM Lists
WHERE (@.IsComplete = -1)
OR (@.IsComplete in (0, 1) AND IsComplete = @.IsComplete)
OR (@.IsComplete = -2 AND Name LIKE '%' + @.SearchText + '%')"
UpdateCommand="UPDATE Lists
SET Name=@.Name, IsComplete=@.IsComplete, Priority=@.Priority
WHERE ListId = @.ListId"
DeleteCommand="DELETE FROM Lists WHERE ListId = @.ListId">
<SelectParameters>
<asp:Parameter Name="IsComplete" Type="Int32" DefaultValue="0" />
<asp:ControlParameter Name="SearchText" Type="string"ControlID="SearchText"
PropertyName="Text" ConvertEmptyStringToNull="false" />
</SelectParameters>
</asp:SqlDataSource>

</form>
<hr />
</body>
</html
Thanks for the help.

I've been wondering about this as well. I'd really, really like the ability to do this. I came up with a short test page to validate the issue outside of my site.

The code for the test page is below. Run this, click "Add Control" and a label will be added to the placeholder control. Click "Refresh" and watch the label control vanish. You can also validate in the debugger that the label control added to the placeholder has disappeared (that is, it's not in the controls collection at Page_Load time()).

Is there something obvious I'm overlooking?

--

<%@. Page Language="C#" %><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><script runat="server"> protected void Page_Load(object sender, EventArgs e) { } protected void Add_OnCommand(object sender, CommandEventArgs e) { Label lab = new Label(); lab.Text = "Dynamically added label"; TestPlaceHolder.Controls.Add(lab); } protected void Refresh_OnCommand(object sender, CommandEventArgs e) { }</script><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title>Dynamically added control test</title></head><body> <form id="form1" runat="server"> <atlas:ScriptManager ID="ScriptManager1" runat="server" /> <atlas:UpdatePanel ID="TestPanel" runat="server"> <ContentTemplate> <asp:PlaceHolder ID="TestPlaceHolder" runat="server"></asp:PlaceHolder> <asp:Button ID="TestAddButton" runat="server" Text="Add Control" OnCommand="Add_OnCommand" /> <asp:Button ID="Refresh" runat="server" Text="Refresh" OnCommand="Refresh_OnCommand" /> </ContentTemplate> </atlas:UpdatePanel> </form></body></html>

^^^ Nevermind. My example didn't state the case correctly. I went back and fixed it and found everything was fine with values updating on dynamic controls.

The problem was in my site with an off-by-one error in control names. With the names corrected, everything is fine.

Saturday, March 24, 2012

About Sys.WebForms.PageRequestManagerParserErrorException error

Hello everybody,

My ajax powered web site throws an error when pressing a button or linkbutton inside an UpdatePanel.

I've searched for a solution. All of the blogposts, solutions etc is about the "common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled." suggestion written in the error text itself.

But in my scenario, only IE6 (and may be below) users see this error. I am using IE7, and my site works like a charm. (all my friends using IE7 doesn't have problems with the site)

I've searched my code for response.write stuff but there isn't any. I've removed some custom controls (msn like popup win, flash container controls etc.) but it's the same with IE6 users. The error is :

--------
Microsoft Internet Explorer
--------
Sys.WebForms.PageRequestManagerParserErrorException: The message received from the server could not be parsed. Common causes for this error are when the response is modified by calls to Response.Write(), response filters, HttpModules, or server trace is enabled.

Details: Error parsing near 'eTitle||Favorilerim|

0

'.
--------
Tamam (OK)
--------

Anybody have suggestions?

Hi bsarica,

Maybe this article is useful for you:

http://support.microsoft.com/default.aspx?scid=kb;en-us;Q312496

Regards,


I forgot to mention smthng.

It is not working on firefox too.


Any other suggestions? :(


I had a very similar error when I encountered code where the asynchronous call back was making a call to Server.Transfer(). I'm not sure whether or not this helps you or not, but doing a Server.Redirect() fixed the problem for me.

about syntax error!

error: syntax error
source document :http://localhost/MyDream/AboutConten.asmx/js
line:3
source code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

my AboutConten.asmx is:

<%@dotnet.itags.org. WebService Language="C#" Class="MyDream1.AbouConten" %>

using System;
using System.Web;
using System.Data.SqlClient;
using System.Configuration;
using System.Web.Services;
using System.Web.Services.Protocols;
namespace MyDream1
{
[WebService(Namespace = "http://tempuri.org/")]
[WebServiceBinding(ConformsTo = WsiProfiles.BasicProfile1_1)]
public class AbouConten : System.Web.Services.WebService
{

[WebMethod]
public string HelloWorld()
{
return "Hello World";
}
[WebMethod]
public string ShowContent(string myId)
{
int id = Convert.ToInt32(myId);
string connStr = ConfigurationManager.AppSettings[0].ToString();
SqlConnection conn = new SqlConnection(connStr);
string cmdStr = "select this_content from myTopic where this_id = @dotnet.itags.org.this_id";
SqlCommand comm = new SqlCommand(cmdStr, conn);
comm.Parameters.AddWithValue("@dotnet.itags.org.this_id", id);
conn.Open();
SqlDataReader dr = comm.ExecuteReader();
dr.Read();
string returnStr = dr[0].ToString();
dr.Close();
conn.Close();
return returnStr;
}

}
}

why?

please help me!

thanks!

What do you see when you navigate to the proxy directly from the browser (typehttp://localhost/MyDream/AboutConten.asmx/js in your address bar)?

A Simple Atlas Work,but Still have Unknown Error BUG

Simply, i Place a Textbox and a button,when i click the button, it response.write(textbox1.text)
but, when i click the button, it show a java script pop-up and show me Unknown error..

below is the code:

1Default.aspx2<%@dotnet.itags.org. Page Language="VB" AutoEventWireup="true" ValidateRequest="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>34<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">5<html xmlns="http://www.w3.org/1999/xhtml">6<head runat="server">7 <title>ASPNET_Atlas_Testing</title>8</head>9<body>10<form id="form1" runat="server">11<div>12 <atlas:ScriptManager ID="ScriptManager1" runat="server" EnablePartialRendering="True"/>13<!-- This section of the page is wrapped by an UpdatePanel. -->14 <atlas:updatepanel id="up" runat="server" mode="Conditional" rendermode="Inline">15 <triggers>16 <atlas:controleventtrigger controlid="TextBox1" eventname="TextChanged" />17 </triggers>18 <contenttemplate>19 <asp:TextBox ID="TextBox1" runat="server" OnTextChanged="TextBox1_TextChanged"></asp:TextBox><br/>20 </contenttemplate>21 </atlas:updatepanel>2223<!-- This section is also wrapped by an UpdatePanel. -->24 <atlas:updatepanel runat="server" id="up1" mode="Conditional" rendermode="Inline">25 <triggers>26 <atlas:controleventtrigger controlid="Button1" eventname="Click" />27 </triggers>28 <contenttemplate>29 <asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click"/>30 </contenttemplate>31 </atlas:updatepanel>32</div>33</form>34</body>35</html>3637
1Default.vb23PartialClass _Default4Inherits System.Web.UI.Page56Protected Sub Button1_Click(ByVal senderAs Object,ByVal eAs System.EventArgs)Handles Button1.Click7 Response.Write(TextBox1.Text)8End Sub910 Protected Sub TextBox1_TextChanged(ByVal senderAs Object,ByVal eAs System.EventArgs)11 Response.Write(TextBox1.Text)12End Sub13End Class1415
Check to make sure your web.config file is setup right and that your dll is in place (/bin) and not corrupt, as I'm not getting a javascript error when I try your code. It also doesn't work as you wrote it, though, and so I tried adding a label to one of the update panels and having the button change its value based on the text prop of the textbox1, and that worked fine. So I suspect that with update panels (this is just a guess) that you can't use Response.Write; whcih would make sense if you conceive of the Response object as passing a whole page rather than just the partial page the update panel is looking for.

Hi,

Remove all response.write statements & replace them with this.page.registerclientscriptblock(script);

Amit Lohogaonkar

mcp,mcad

lohogaonkaramit@.yahoo.com

A Serious Error

I noticed that 'Atlas' works bad if the page title (the 'title' element of the 'head') contains character entities, like '–'. Partial rendering of for example a 'GridView' does not work at all.

hello.

this is a known bug to the current implementation since the title isn't wrapped in a cdata...

A Script on this page is causing Internet Explorer to run slowly. If it continues to run,

I am getting a weird error when the Web Page Loads.

Stop running this script?

A Script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive.

Yes / No

The Web Page has the following AJAX Atlas Controls;

CollapsiblePanel, ModalPopup

The WebPage has a Parent and Child Repeater Control which has the ModalPopup Controls embedded in them for each record. The Modal Popups are used to display the details of each record as well as enable editting of these records.

Do let me know what could result in this error. Any help / suggestion would be appreciated.

Regards,

Abhijit

Please try your scenario with the recently available61121 release of the Toolkit (and ASP.NET AJAX Beta 2). If the problem persists, then please reply with acomplete, self-contained sample page that demonstrates the problem so that we can investigate the specific behavior you're seeing. Thank you!

A runtime error has occurred. Do you wish to debug ? Help

I get the subject error when i try to run sample asp.net ajax aps and even some day to day web pages. It seems to be "an unhandled exception (persmission denied" and "Jscript runtime error: Permission denied"

Simple error but I must be simple minded. What is going on?

Thanks for any help Pauley

;

hello.
you must give us more info if you want us to help you.

Hello Luis, thanks for responding. I think I am ok, I found a post to change advanced settings in Internet Explorer to NOT give a notice of script error. I did and I think I am ok now. I assume there are flaws in some code which IE exposes when it runs and that caused the error message.

Thank you.


hello.

you shouldn't do that. in fact, you should do the opposite in order to be notified about all the errors on your pages. if you're getting an exceptio, then believe me: there's something wrong with your code!

Wednesday, March 21, 2012

a first-day atlas user got this error, HELP!

when i following the basic atlas application from the following link, btw, I didn't use visual studio, I just manually do it from text editor and command line compiler.

http://atlas.asp.net/docs/Walkthroughs/GetStarted/Basic.aspx

I got a "syntax error" when I launched the page. then when i input text and pressed button, I got "sample undefined" error and nothing happen.

This is the log :

2006-06-29 20:21:18 192.168.1.1 - 192.168.1.36 80 GET /AtlasScript.aspx - 200 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727) -
2006-06-29 20:21:19 192.168.1.1 - 192.168.1.36 80 GET /WebResource.axd d=-qnjsxFIQPRe60N1ywfq1ZGbOVMGC5TKMX4JTqrXTR7atJCaMTR4Fc76IpI0uvmBTmmGba1jsr6v9f3MrKscIivr3HdGL-IH8Yqrm9oH01I1&t=632799165960000000 200 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727)http://www.mydomain.com/AtlasScript.aspx
2006-06-29 20:21:19 192.168.1.1 - 192.168.1.36 80 GET /HelloWorldService.asmx - 302 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727)http://www.mydomain.com/AtlasScript.aspx
2006-06-29 20:21:19 192.168.1.1 - 192.168.1.36 80 GET /ErrorPage.aspx aspxerrorpath=/HelloWorldService.asmx/js 200 Mozilla/4.0+(compatible;+MSIE+6.0;+Windows+NT+5.0;+.NET+CLR+1.1.4322;+.NET+CLR+2.0.50727)http://www.mydomain.com/AtlasScript.aspx

hello.

can you be more specific about the error? is it a script error?


yes, it's a script error from browser(IE)

hello again.

well, where are you getting it? what does the error message say? where does it stop in the debugger? what's your code? without knowing this we won't be able to help you.


PROBLEM solved, I followed the installation instruction to modify web.config, it failed, buy when I copied the web.config from atlas folder, it works now!

Thank you very much!

A Circular Reference Was Detected error

Hi there,

This has been confusing me to no ends for the past weekend and I ask for your help. When I try to access an IList of Type <SampleRow> or any list structure for that matter, I get this:

A circular reference was detected while serializing an object of type ...<- Many types have popped up (System.Reflection.Module) for example.

I've been trying to run the samples in the documentation with no more success (same error). I'm thinking this has to do with some libraries loaded and not the code itself. I have looked in the GAC, uninstalled/reinstalled everything from VS2005 to the ATLAS Framework (even IIS) with no go. I need to get the list structure for the listview control of ATLAS. It this can help, I'm pasting the stacktrace. Also, I'm not sure this is a specific ATLAS error but I can't tell otherwise. Thanks for your help. If you need anything more, please ask.Smile

[InvalidOperationException: A circular reference was detected while serializing an object of type 'System.Reflection.Module'.]
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValueInternal(Object o) +766
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValue(Object o) +90
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeCustomObject(Object o) +706
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValueInternal(Object o) +908
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValue(Object o) +90
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeCustomObject(Object o) +706
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValueInternal(Object o) +908
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValue(Object o) +90
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeCustomObject(Object o) +706
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValueInternal(Object o) +908
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValue(Object o) +90
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeCustomObject(Object o) +706
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValueInternal(Object o) +908
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValue(Object o) +90
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeEnumerable(IEnumerable enumerable) +159
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValueInternal(Object o) +874
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValue(Object o) +90
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeCustomObject(Object o) +706
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValueInternal(Object o) +908
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.SerializeValue(Object o) +90
Microsoft.Web.Script.Serialization.JavaScriptObjectSerializer.Serialize(Object o, IJavaScriptSerializationContext context) +62
Microsoft.Web.UI.Controls.InitialData.GetDataServiceResult() +589
Microsoft.Web.UI.Controls.InitialData.RenderScript(ScriptTextWriter writer) +248
Microsoft.Web.UI.Controls.InitialData.Microsoft.Web.Script.IScriptObject.RenderScript(ScriptTextWriter writer) +31
Microsoft.Web.UI.ScriptManager.RenderXmlScript(TextWriter writer) +735
Microsoft.Web.UI.ScriptManager.OnPagePreRenderComplete(Object sender, EventArgs e) +663
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Page.OnPreRenderComplete(EventArgs e) +96
System.Web.UI.Page.PerformPreRenderComplete() +32
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +479

Lesson learned: commenting the web.config file temporarily and forgetting about it is a bad idea. I had the converters section commented out, re-enabling them solved the problem. If it can help anyone to learn from my mistake then I won't have posted in vain!

Thanks.

60731 error

I heve the following code

<asp:TextBox ID="txtde_la" runat="server" CssClass="TextBox"
Font-Bold="True" Font-Size="XX-Small" Width="30%" OnInit="txtde_la_Init"></asp:TextBox>
<asp:RegularExpressionValidator ID="validde_la" runat="server" ErrorMessage="*"
Font-Bold="True" ControlToValidate="txtde_la"></asp:RegularExpressionValidator>
<asp:Panel ID="Panel1" runat="server">
<atlas:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<atlasToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server">
<atlasToolkit:PopupControlProperties PopupControlID="Panel1" Position="Bottom" TargetControlID="txtde_la" ID="foo" />
</atlasToolkit:PopupControlExtender>
<center>
<asp:Calendar ID="Calendar3" runat="server" BackColor="White" BorderColor="#999999"
CellPadding="1" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
ForeColor="Black" OnSelectionChanged="Calendar3_SelectionChanged" Width="160px">
<SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
<TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
<SelectorStyle BackColor="#CCCCCC" />
<WeekendDayStyle BackColor="#FFFFCC" />
<OtherMonthDayStyle ForeColor="Gray" />
<NextPrevStyle VerticalAlign="Bottom" />
<DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
<TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
</asp:Calendar>
</center>
</ContentTemplate>
</atlas:UpdatePanel>
</asp:Panel>

protected void txtde_la_Init(object sender, EventArgs e)
{
System.Threading.Thread.CurrentThread.CurrentCulture = new System.Globalization.CultureInfo("ro-RO", false);
DateTime dt = new DateTime();
dt = DateTime.Today;
txtde_la.Text = txtpana_la.Text = dt.ToShortDateString() + " " + System.DateTime.Now.ToShortTimeString();
}

After upgrading to 60731 on Panel at design time I get the following error: The control collection cannot be modified during DataBind, Init, Load, PreRender or Unload phases.

And another problem with an TextBoxWatermarkExtender on the same page.

After selecting a date on that Calendar the watermark text dissapears.

Sorin

Shawn outlines the Atlas change that introduced locking and the workaround for the resulting problem here:http://forums.asp.net/thread/1358703.aspx.