I have an asmx web service that has the following function: <CODE> [WebMethod] public List&amp;amp;lt;Tag&amp;amp;gt; GetTags() { List&amp;amp;lt;Tag&amp;amp;gt; TagList = new List&amp;amp;lt;Tag&amp;amp;gt;(); DataTable dt = Helpers.Tags.GetTags();
foreach (DataRow dr in dt.Rows) { Tag t = new Tag(); t.TagName = dr[&amp;amp;quot;Tag&amp;amp;quot;].ToString(); t.TagDescription = dr[&amp;amp;quot;Description&amp;amp;quot;].ToString(); TagList.Add(t); } return TagList; } </CODE> Here&amp;amp;#39;s
the Tag Class: public class Tag { public string TagName { get; set; } public string TagDescription { get; set; } } The GetTags() method returns an object List of Tag Objects. I have an AutoComplete function in jQuery that accepts an array of the following
format:
var availableTagsCustom = [ { tagName: &amp;amp;#39;Ruby&amp;amp;#39;, tagDescription: &amp;amp;#39;Ruby is an open-source dynamic...&amp;amp;#39; }, { tagName: &amp;amp;#39;Scala&amp;amp;#39;,
tagDescription: &amp;amp;#39;Scala is a general purpose programming language...&amp;amp;#39; }, { tagName: &amp;amp;#39;Scheme&amp;amp;#39;, tagDescription: &amp;amp;#39;Scheme is a functional programming language....&amp;amp;#39; }
];
How do I translate or convert the &amp;amp;quot;object List of Tag Objects&amp;amp;quot; that I receive into this format? Thank you. I DONT KNOW WHY MY POST ISN"T FORMATTING CORRECTLY.
I don't understand what's wrong with the post, I can't get it to format correctly. What do I use to enclose source code? [code] [/code] tags didn't work
skyxn3t
Member
1 Points
19 Posts
How to pass an array of Objects into a format jQuery Ajax understands?
Jul 14, 2012 05:56 PM|LINK
KumarHarsh
All-Star
15133 Points
3647 Posts
Re: How to pass an array of Objects into a format jQuery Ajax understands?
Jul 14, 2012 06:14 PM|LINK
yes really we r not able to understand ur post.
repost it
Kumar Harsh
skyxn3t
Member
1 Points
19 Posts
Re: How to pass an array of Objects into a format jQuery Ajax understands?
Jul 14, 2012 08:35 PM|LINK
BU XI - MSFT
All-Star
22367 Points
2704 Posts
Microsoft
Re: How to pass an array of Objects into a format jQuery Ajax understands?
Jul 17, 2012 10:30 AM|LINK
Hello
You may continue this topic in your own thread, http://forums.asp.net/t/1824045.aspx
If you have any feedback about my replies, please contact msdnmg@microsoft.com.
Microsoft One Code Framework