Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Web Programming > Adobe Web Programming > Flex
|
Flex Discuss the Adobe Flex programming language
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Flex section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 28th, 2008, 08:12 AM
Registered User
 
Join Date: Aug 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Default Application using FLEX and ASP.net

Hi Friends,

Is it possible to pass Flex data to ASP.net(C#) application.?
process that data using ASP.net(C#) and then create XML file of resulting data.
Pass this XML file to again Flex and display those on FLEX application.

Is this type of application is possible?
if yes, please help me to make such an application.

Thank You!

Tejas Patel.

T.S.Patel
 
Old January 30th, 2008, 10:25 PM
Authorized User
 
Join Date: Feb 2007
Posts: 37
Thanks: 1
Thanked 0 Times in 0 Posts
Default

yes its possible and thats how flex works. You can get or send data using HTTPServiceComponent,WebserviceComponent or Using Flex Remoting comoponent.

     Create simple webservice in ASP.NET/C# (Your choice) create simple Method which accept parameter say NoOfRecords to display which you will pass from flex ( assuming you are using web service component).Pass this parameter from Flex like this way

<mx:WebService id="myWebService"
     wsdl="http://localhost:4140/Test.asmx?WSDL"
     showBusyCursor="true" fault= "Alert(event.fault.faultString)">
<mx:operation name = "getEmployees">
            <mx:request>5
            </mx:request>
</mx:operation>
</mx:WebService>

         On ASP.NET c# WebService end get this parameter and populate or create object array (for XML you can using XMLDocument object) and pass back to flex where you will bind result to DataGrid as below


    <mx:DataGrid id="empNames" dataProvider="{myWebService.getEmployees.lastResul t}" x="228" y="110" width="323">
         <mx:columns>
            <mx:DataGridColumn headerText="Name" dataField="name" />
            <mx:DataGridColumn headerText="Department" dataField="department"/>
        </mx:columns>
    </mx:DataGrid>

Thats all ...you can make it fancier later...sorry for not creating entire code as its easy..Make sure you compile your webservice and set you url accordingly to point WSDL.

Have fun.

PS: On C# Side you can write usual way

[WebMethodAttribute(Description = "Get a list of employees")]
        public Employee[] getEmployees(int noOfRecords)
        {
            //Create array of employees for noOfRecords times

         Employee[] employees = new Employee[2];
            employees[0] = new Employee();
            employees[0].name = "Bob";
            employees[0].department = 123;
            employees[1] = new Employee();
            employees[1].name = "Mary";
            employees[1].department = 456;
            return employees; // Flex will get this back from webservice as -myWebService.getEmployees.lastResult

        }

 public class Employee
    {
        public string name;
        public int department;

    }





Similar Threads
Thread Thread Starter Forum Replies Last Post
Data Synchronization between Abode Flex & ASP.net tejas83 ASP.NET 2.0 Professional 0 January 28th, 2008 07:58 AM
Show videos in FLEX Application abhishekchess1 ASP.NET 1.0 and 1.1 Professional 1 October 4th, 2007 10:25 AM
ASP and ASP.NET mixture for protecting application BananaJim ASP.NET 2.0 Professional 0 December 6th, 2006 02:19 PM
Convert ASP web application to ASP.NET Steve777 ASP.NET 1.0 and 1.1 Basics 3 June 2nd, 2005 07:26 AM
Creating ASP.NET Application in Visual Studio.NET Maxood ASP.NET 1.0 and 1.1 Basics 1 March 8th, 2004 01:56 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.