Data Interaction Between flash as2.0 and ASP. NET (C #)

Source: Internet
Author: User

Flash end
VaR sendvars: loadvars = new loadvars ();
VaR javasevars: loadvars = new loadvars ();
Incluevars. onload = function (success: Boolean): void {
If (SUCCESS)
{
If (evars. OK! = Undefined)
{
Intext. Text = "";
Intxt. Text = "";
Status_lbl.text = "<B> successfully published </B> ";
}
Else
Geturl ("javascript: Alert ('wrong ');");
}
Else
{
Geturl ("javascript: Alert ('posting failed! ');");
}
}

Submit_btn.clickhandler = function (){
Callsave ();
}

Function callsave ()
{
VaR url = "accesslink. aspx ";
Sendvars. nn = escape (intext. Text );
Sendvars. Ct = escape (intxt. Text );
Sendvars. Op = "add ";
Sendvars. sendandload (URL, incluevars, "Post ");
Wait. gotoandplay (1 );
}

C # client acceptance:
Oledbconnection conn = new oledbconnection (configurationmanager. receivettings ["myjetconn"]);
String SQL = "insert into message (nicename, content) values (?,?) ";
Oledbcommand cmd = new oledbcommand (SQL, Conn );
Cmd. Parameters. Add (New oledbparameter ("@ nicename", oledbtype. varchar, 10 ));
Cmd. Parameters ["@ nicename"]. value = server. urldecode (request. Form ["Nn"]. tostring ());
Cmd. Parameters. Add (New oledbparameter ("@ content", oledbtype. varchar, 50 ));
Cmd. Parameters ["@ content"]. value = server. urldecode (request. Form ["CT"]. tostring ());
Conn. open ();
Cmd. executenonquery ();
Conn. Close ();
Response. Write ("modification successful! ");

Web configuration, here to add or garbled, flash inside is the default UTF-8
<System. Web>
<Globalization requestencoding = "UTF-8" responseencoding = "UTF-8"/>
</System. Web>

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.