PDA

View Full Version : How to Bind ASP Results to Combo Box


sethu
02-16-2009, 08:32 AM
I am new to Flex. Have ASP page and it contains the result which is derived from Database.I formed the result as XML.

In Flex, I have one Combo box and Submit button. When i click the submit button ASP results would be loaded in to Combo box.

How do i bind the result to Combo Box?



Pls help me out

wvxvw
02-16-2009, 08:52 AM
What have you tried and what didn't work? Have you tried HTTPService / WebService / RemoteObject?

sethu
02-16-2009, 08:56 AM
i Used HTTPService and its resultformat is "e4x"

wvxvw
02-16-2009, 09:26 AM
See this thread:
http://www.actionscript.org/forums/showthread.php3?t=197386
It should be the same for ASP.

sethu
02-16-2009, 09:34 AM
var XMLResults:XML = event.result as XML;
combo1.dataProvider = XMLResults.Cinfo;
combo1.labelField = XMLResults.Cinfo.City_name;


my XML is like

<City>
<cinfo>
<city_name>India</city_name>
<city_code>1</city_code>
</cinfo>
<cinfo>
<city_name>USA</city_name>
<city_code>2</city_code>
</cinfo>
</City>


how do i refer my node?

wvxvw
02-16-2009, 10:06 AM
Maybe you should really read a bit about basics?
http://livedocs.adobe.com/flash/9.0/ActionScriptLangRefV3/XML.html
Here's the manual on XML API. A good place to start reading... And, sorry, I'm really not an ASP programmer, so, maybe someone else can help you... or just ask at some ASP forum about how you work with XML in ASP, I really don't know.

sethu
02-17-2009, 05:28 AM
Thanks for your reply,

I got the o/p from ASP, .NET as XML. After getting result how can i bind that combo box. If i bind given format

var XMLResults:XML = event.result as XML;
combo1.dataProvider = XMLResults.Cinfo;
combo1.labelField = XMLResults.Cinfo.City_name;

got XML string inside the combo box without formatting.

Pls help me out