Errore Ajax

sabato 20 gennaio 2007 - 01.21

squilibrio Profilo | Expert

Ciao a tutti, secondo voi da cosa dipende questo errore...

'Sys' non è definito



<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Loading.aspx.cs"
Inherits="UI_Test_Loading" %>
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0,
Culture=neutral, PublicKeyToken=31bf3856ad364e35" Namespace="System.Web.UI"
TagPrefix="asp" %>

<!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>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server" />
<div>
<table>
<tr>
<td valign="top">
<asp:UpdatePanel ID="UpdatePanel1"
runat="server">
<ContentTemplate>
<asp:DropDownList ID="DropDownList1"
runat="server" DataSourceID="XmlDataSource1"
onSelectedIndexChanged="GetDropDownContents"
DataTextField="NAME"
DataValueField="RIF" CausesValidation="false" AutoPostBack="true"
AppendDataBoundItems="false">
</asp:DropDownList>
<br />
<br />
<asp:DropDownList ID="DropDownList2"
runat="server" DataSourceID="XmlDataSource2"
DataTextField="NAME"
DataValueField="RIF" AppendDataBoundItems="false">
</asp:DropDownList>
<asp:XmlDataSource ID="XmlDataSource2"
runat="server" DataFile="~/UI/Test/XMLFile.xml"
XPath="//DOCUMENT/PROVINCE/PROVINCIA[@REGIONID='1']"></asp:XmlDataSource>
<asp:XmlDataSource ID="XmlDataSource1"
runat="server" DataFile="~/UI/Test/XMLFile.xml"
XPath="//DOCUMENT/REGIONS/REGION"></asp:XmlDataSource>

</ContentTemplate>
</asp:UpdatePanel>
</td>
<td>
<asp:Label ID="Label1" runat="server" Text=""
Font-Names="Tahoma"></asp:Label>
</td>
</tr>
</table>
</div>
</form>
</body>
</html>

freeteo Profilo | Guru

ciao,
ti manca questa "mappatura" alla dll di ajax nel web.config:
<httpHandlers> <add verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" validate="false" />
basta che lo aggiungi e dovresti non avere piu' quel messaggio di errore, inquanto l'pggetto "Sys" si trova proprio dentro alla "parte javascrip" di ajax...



ciao.

Matteo Raumer
[MCAD .net]
http://blogs.dotnethell.it/freeteo

squilibrio Profilo | Expert

Grazie mille provo subito!!!

squilibrio Profilo | Expert

Niente :-( ottengo lo stesso errore

squilibrio Profilo | Expert

Ci sto riuscendo

Secondo te, questo nuovo errore da cosa dipende???


Non riuscivo a trovare la DLL Microsoft.Web.Preview.dll

ne ho utilizzata una presente in un esempio e l'ho inserita nella bin dell'esempio che sto cercando di eseguire

ma non capisco dove sbaglio




Server Error in '/TaskList' Application.
--------------------------------------------------------------------------------

Assembly 'Microsoft.Web.Preview, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not contain a Web resource with name 'PreviewScript.js'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.InvalidOperationException: Assembly 'Microsoft.Web.Preview, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not contain a Web resource with name 'PreviewScript.js'.

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

freeteo Profilo | Guru

ciao,
non capisco quella libreria a che versione di ajax faccia riferimento.
Ti consiglio di scaricare la RC1 dal sito http://ajax.asp.net e poi ti basta copiare la dll "System.Web.Extesion" che trovi in "C:\Programmi\Microsoft ASP.NET\ASP.NET 2.0 AJAX Extensions\v1.0.61025" sotto alla bin del sito, fare riferimento a lei per aggiungere nella toolbox i componenti, e poi aggiungere la riga al web.config che ti ho postato prima, vedrai che funziona...
ciao.

Matteo Raumer
[MCAD .net]
http://blogs.dotnethell.it/freeteo

squilibrio Profilo | Expert

Niente :(

Ho copiato le DLL, il web.config è già OK

sto provando ad usare l'esempio TaskList presente in ASP.NET\ASP.NET Ajax Sample Applications....\v1.0.06...\TaskList

Eppure ottengo l'errore indicato sul file JS

Cosa sbaglio?

freeteo Profilo | Guru

ciao,
ma tu hai aggiunto alla toolbox i componenti di ajax ? si vedono e puoi fare drag&drop?
Per fare qusto devi fare "tastoDX->choose items" sopra alla toolbox, poi andare in "browse" e selezionare la dll di ajax.
Dopodiche li vedi nella toolbar, e puoi trascinarli nelle varie pagine.

Quando li trascini lui mette il tag dentro nella pagina che mappa quei componenti con quella libreria, ovvero:
<%@ Register Assembly="System.Web.Extensions" Namespace="System.Web.UI" TagPrefix="asp" %>

Se sai gia' che devi usarlo in tutte le pagine, puoi metterlo anche a livello di web.config:
Il codice sorgente non è stato renderizzato qui
perchè non c'è sufficiente spazio.
Clicca qui per visualizzarlo in una nuova finestra
ma io lavorerei con gli oggetti nella toolbox.

Cmq sia, tutti questi problemi sono evitabili se parti dalla creazione di un nuovo sito ajax (quando fai "nuovo sito web" da visual studio intendo) dato che porta giu' la configurazione gia a posto...
ciao.

Matteo Raumer
[MCAD .net]
http://blogs.dotnethell.it/freeteo

Andrl Profilo | Junior Member

Avevo anch'io lo stesso problema, e ho risolto copiando le tre dll nella cartella bin AJAXExtensionsToolbox.dll, System.Web.Extensions.Design.dll, System.Web.Extensions.dll

CIAO!!!
Partecipa anche tu! Registrati!
Hai bisogno di aiuto ?
Perchè non ti registri subito?

Dopo esserti registrato potrai chiedere
aiuto sul nostro Forum oppure aiutare gli altri

Consulta le Stanze disponibili.

Registrati ora !
Copyright © dotNetHell.it 2002-2025
Running on Windows Server 2008 R2 Standard, SQL Server 2012 & ASP.NET 3.5