btn.addEventListener(MouseEvent.MOUSE_DOWN,senddata); function senddata(e:MouseEvent) { var scriptRequest:URLRequest = new URLRequest("Default.aspx"); var scriptLoader:URLLoader = new URLLoader(); var scriptVars:URLVariables = new URLVariables(); scriptLoader.addEventListener(Event.COMPLETE, handleLoadSuccessful); scriptLoader.addEventListener(IOErrorEvent.IO_ERROR, handleLoadError); scriptVars.var1 = "one"; scriptRequest.method = URLRequestMethod.POST; scriptRequest.data = scriptVars; scriptLoader.load(scriptRequest); function handleLoadSuccessful($evt:Event):void { txt.text="sent"; trace("Message sent."); } function handleLoadError($evt:IOErrorEvent):void { txt.text="failed"; trace("Message failed.") } }
protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { if (Request["var1"] != null) { TextBox1.Text = Request["var1"]; } } }
IsPostBack
protected void Page_Load(object sender, EventArgs e) { if (Request["var1"] != null) { TextBox1.Text = Request["var1"]; } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)