Zurück   Flashforum > Flash > ActionScript > ActionScript 3

Antwort
 
LinkBack Themen-Optionen Ansicht
Alt 09-07-2010, 12:49   #1 (permalink)
Neuer User
 
Registriert seit: Jan 2004
Beiträge: 67
URLVariables Problem

Hallo zusammen.

Ich hab ein Problem mit einem Kontaktformular, das eine ASPX-Seite aufruft. Wenn ich auf "senden" klicke erhalte ich folgende Fehlermeldung (im Browser, localhost un online):

Code:
Error: Error #2101: Der an URLVariables.decode() übergebene String muss ein URL-kodierter Abfrage-String mit Name/Wert-Paaren sein.
at Error$/throwError()
at flash.net::URLVariables/decode()
at flash.net::URLVariables()
at flash.net::URLLoader/onComplete()
Ausserdem funktioniert die Rueckgabe/Auswertung nicht, soll heissen er bleibt immer bei "Sende daten" haengen, de COMPLETE event des URLLoaders wird jedoch nie ausgefuehrt.

Komischerweise kommen die gesendeten Daten ohne Probleme bei der Ziel-Adresse in meinem Outlook an.

Hat jemand ne Idee woran das liegen koennte?

Gracias
KaroAS
KaroAS ist offline   Mit Zitat antworten
Alt 09-07-2010, 14:00   #2 (permalink)
lebt in stereo
 
Benutzerbild von figure8
 
Registriert seit: Mar 2008
Ort: karlsruhe
Beiträge: 1.093
zeig mal ein bißchen code
__________________
* Flash-JunkieMusiker & Grafiker

# Marvin Blase
# Speaker, Author, Silly Billy.
# @beautifycode
figure8 ist offline   Mit Zitat antworten
Alt 12-07-2010, 11:10   #3 (permalink)
Neuer User
 
Registriert seit: Jan 2004
Beiträge: 67
Hallo. Hier der Code der Funktion:

Code:
private function enviarDatos(e:MouseEvent):void {
			formulario_mc.nombreError_txt.text = "";
			formulario_mc.telefonoError_txt.text = "";
			formulario_mc.direccionError_txt.text = "";
			if (formulario_mc.nombre_txt.text != "nombre" && formulario_mc.telefono_txt.text != "teléfono" && formulario_mc.direccion_txt.text != "dirección") {
				var reqForm:URLRequest = new URLRequest("default2.aspx");
				var variables:URLVariables = new URLVariables();
				variables.senderName = formulario_mc.nombre_txt.text;
				variables.senderTel = formulario_mc.telefono_txt.text;
				variables.senderDir = formulario_mc.direccion_txt.text;
				variables.senderMsg = formulario_mc.comentarios_txt.text;
				reqForm.method = URLRequestMethod.POST;
				reqForm.data = variables;
				var loaderForm:URLLoader = new URLLoader(); 
				loaderForm.dataFormat = URLLoaderDataFormat.VARIABLES;
				estado_mc.x = stage.stageWidth/2;
				estado_mc.y = stage.stageHeight/2;
				estado_mc.gotoAndStop(1);
				loaderForm.load(reqForm);
				loaderForm.addEventListener(Event.COMPLETE, confirmacion);
			} else {
				if (formulario_mc.nombre_txt.text == "nombre") {
					formulario_mc.nombreError_txt.text = "*";
				}
				if (formulario_mc.telefono_txt.text == "teléfono") {
					formulario_mc.telefonoError_txt.text = "*";
				}
				if (formulario_mc.direccion_txt.text == "dirección") {
					formulario_mc.direccionError_txt.text = "*";
				}
			}
		}
Der MovieClip "estado_mc" zeigt im ersten Frame "sende daten" und im zweiten "daten gesendet" oder halt nicht. Das hier ist die Rueckgabe-Funktion:

Code:
private function confirmacion(e:Event):void {
			if (RetVal) {
				estado_mc.gotoAndStop(2);
			} else {
				estado_mc.gotoAndStop(3);
			}
		}
Und hier noch das ASP Script:

Code:
public partial class _Default2 : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        string senderTel = Request.Params["senderTel"];
        string senderDir = Request.Params["senderDir"];
        string senderName = Request.Params["senderName"];
        string senderMsg = Request.Params["senderMsg"];
        if ((senderTel != null) && (senderDir != null) && (senderName != null) && (senderMsg != null))
        {
            StringBuilder mailBody = new StringBuilder();
            mailBody.Append(dinamiq.Correo.SALTO_LINEA).Append(dinamiq.Correo.SALTO_LINEA);
            mailBody.Append("Nombre : " + senderName).Append(dinamiq.Correo.SALTO_LINEA).Append(dinamiq.Correo.SALTO_LINEA);
            mailBody.Append("Telefono : " + senderTel).Append(dinamiq.Correo.SALTO_LINEA).Append(dinamiq.Correo.SALTO_LINEA);
            mailBody.Append("Direccion : " + senderDir).Append(dinamiq.Correo.SALTO_LINEA).Append(dinamiq.Correo.SALTO_LINEA);
            mailBody.Append("Comentarios : " + senderMsg).Append(dinamiq.Correo.SALTO_LINEA).Append(dinamiq.Correo.SALTO_LINEA);
            mailBody.Append(dinamiq.Correo.SALTO_LINEA).Append(dinamiq.Correo.SALTO_LINEA);
            string mailFrom = System.Configuration.ConfigurationManager.AppSettings.Get("mail.from");
            string mailTo = System.Configuration.ConfigurationManager.AppSettings.Get("mail.to");
            string mailBcc = System.Configuration.ConfigurationManager.AppSettings.Get("mail.bcc");
            string mailSubject = System.Configuration.ConfigurationManager.AppSettings.Get("mail.subject");
            bool resultado = dinamiq.Correo.enviarCorreo(mailFrom, mailTo, mailBcc, mailSubject, mailBody.ToString(), null);
			Request.Params.Add("RetVal", resultado.ToString());
        }
    }
}
Weiss jemand wo das Problem versteckt sein koennte?
KaroAS ist offline   Mit Zitat antworten
Antwort

Lesezeichen

Themen-Optionen
Ansicht

Forumregeln
Es ist Ihnen nicht erlaubt, neue Themen zu verfassen.
Es ist Ihnen nicht erlaubt, auf Beiträge zu antworten.
Es ist Ihnen nicht erlaubt, Anhänge hochzuladen.
Es ist Ihnen nicht erlaubt, Ihre Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks sind an
Pingbacks sind an
Refbacks sind an


Ähnliche Themen
Thema Autor Forum Antworten Letzter Beitrag
URLVariables in JSP auslesen fedarius Coldfusion und J2EE 2 20-06-2010 08:31
Probleme mit URLRequest und URLVariables Arne Drews ActionScript 3 9 23-12-2009 11:59
URLRequest und URLVariables thembones410 ActionScript 3 1 27-11-2009 11:06
[Flash CS4] urlvariables an swf per Loader janpedder Flash Einsteiger 0 07-05-2009 10:27
URLVariables subclassen Rudi Ratlos ActionScript 3 0 29-08-2007 15:39


Alle Zeitangaben in WEZ +1. Es ist jetzt 19:38 Uhr.

Domains, Webhosting & Vserver von Host Europe
Unterstützt das Flashforum!
Adobe User Group


Copyright ©1999 – 2012 Marc Thiele