View Full Version : Remoting help
Shahzeb
10-20-2005, 01:51 PM
Any body have simple remoting project with ASP.NET
Explanation:
I just want to enter user id and password in Flash, It will call ASP.NET bussiness logic using flash remoting. then specific user information will be appeared in flash. Anybody can help me.
I am awaiting to your reply.
Regards
Shahzeb
cjs500
10-21-2005, 05:11 AM
I'm not sure if you are planning on using HTTPS to run your login. Just an FYI, I've read that a lot of users are having issues in the same way I am with IE, SSL and Flash remoting regardless of the backend. Some saying they solved their issue but relating to XML communication rather than flash remoting.
I haven't used ASP .NET for remoting so I am not sure how I can help you there. I have done a lot of VB and ASP, if I see anything regaring ASP how to I'll add the link.
J_Miller
10-21-2005, 08:44 PM
Hello...
Here is a quick example i put together for you to maybe help get you going. Please note that you will need to change all of the paths to reflect your project. Take a look through and if you have any questions regarding any of this, hit me back and I can try to go into more detail.
Hope this helps!!
////////////////////////////////////////////////////////////////////////
////////////////// REMOTING SOURCE FILES ////////////////////////
///////////////////////////////////////////////////////////////////////
#include "NetServices.as"
#include "NetDebug.as"
////////////////////////////////////////////////////////////////////////
/////////////////// FLASH REMOTING CODE /////////////////////////
///////////////////////////////////////////////////////////////////////
// REMOTING OBJECT
var Remoting = new Object();
// REMOTING OBJECT VARS
Remoting.ServiceURL = "http://www.yourdomain.com/flashremoting/gateway.aspx";
Remoting.ServicePath = "your.service.path";
Remoting.MyConnection;
Remoting.MyService;
// MAKE REMOTING CALL
Remoting.MakeCall = function(RemoteFunction, ParamsObj){
trace("Make Remoting Connection");
this.MyService = this.MyConnection.getService(this.ServicePath, new _root.Remoting[RemoteFunction + "_Result"]());
this.MyService[RemoteFunction](ParamsObj);
}
// INITIALIZE REMOTING CONNECTION
Remoting.Initialize = function(){
// SET DEFAULT REMOTING VALUES
if (_root.serviceURL != undefined){
this.ServiceURL = _root.serviceURL;
}
if (_root.servicePath != undefined){
this.ServicePath = _root.servicePath;
}
// SET REMOTING CONNECTION
NetServices.setDefaultGatewayUrl(this.ServiceURL);
this.MyConnection = NetServices.createGatewayConnection();
}
Remoting.Initialize();
///////////////////////////////////////////////////////////////////////
////////////////////// REMOTING RESULTS /////////////////////////
///////////////////////////////////////////////////////////////////////
// SAMPLE REMOTING CALL
Remoting.MakeCall("init", null);
// SAMPLE REMOTING RESULTS
Remoting.init_Result = function(result){
// ON SUCCESSFULL RESULT
this.onResult = function(result){
trace("Initialize Results");
}
// ON ERROR RESULT
this.onStatus = function(error){
trace("ERROR CODE: " + error.code);
trace("ERROR DESCRIPTION: " + error.code);
trace("ERROR DETAILS: " + error.details);
}
}
///////////////////////////////////////////////////////////////////////
/////////////////////// ASP.NET CODE //////////////////////////////
///////////////////////////////////////////////////////////////////////
<%@ Page Language="VB" %>
<%@ Register TagPrefix="MyTag" Namespace="FlashGateway" Assembly="flashgateway" %>
<MyTag:Flash ID="Flash" Runat="Server" />
<script runat="server">
Sub Page_Load(Source as Object, E as EventArgs)
'YOUR BACK END LOGIC HERE
'RESULTS BACK TO FLASH
Flash.DataSource = YOUR_DATASET_HERE
Flash.DataBind()
End Sub
</script>
<MyTag:Flash />
|
vBulletin® v3.8.4, Copyright ©2000-2009, Jelsoft Enterprises Ltd.