Answered by:
Confused between Client side and Server Side mixing (C#/jQuery)

Question
-
If using a jQuery addin, for example I am testing with this carousal:
http://caroufredsel.dev7studios.com/download.php
I am not confused with how it works from a scripting perspective, but how would one mix it with server side code? For example, this code exists in an ASP.NET web application that makes a service call that retrieves a List<something> to bind to this jQuery. Since this is just on the page, how does one do the databinding? I know how to do it with regular composite controls, but really can't figure out how to mix the two!
TIA!
- Moved by Bob Shen Friday, June 21, 2013 9:07 AM
Monday, June 10, 2013 5:48 PM
Answers
-
Monday, June 10, 2013 8:58 PM
-
You can't.
You'll have to pass the list via JSON object or any other way to the page,
and only then, use it with Jquery.
Noam B.
Do not Forget to Vote as Answer/Helpful, please. It encourages us to help you...Wednesday, June 12, 2013 10:15 AM
All replies
-
Monday, June 10, 2013 8:58 PM
-
You can't.
You'll have to pass the list via JSON object or any other way to the page,
and only then, use it with Jquery.
Noam B.
Do not Forget to Vote as Answer/Helpful, please. It encourages us to help you...Wednesday, June 12, 2013 10:15 AM -
Actually this question belongs to asp.net.
anyhow have a server method in a code behind and it with Jquery ajax method and in succes you will get the list of item and bind it to your jquery plugin.
in below code, webmethod is the aspx file in which has GetProductById as public method in code behind
var ProductDetails = { imagesList: '', CurrentImage: '', GetProductDetailsById: function (paramid) { var param = paramid; param = $.trim(param); try { $.ajax({ type: "POST", url: "../WebMethod.aspx/GetProductById", contentType: "application/json; charset=utf-8", data: "{parameter : '" + param + "'}", dataType: "json", success: ProductDetails.GetProductDetailsByIdCompleted, error: function (xhr, status) { var err1 = xhr; var err2 = xhr; } }); } catch (ex) { } },
Thanks & Regards
Syed Amjad Sr. Silverlight/WPF Developer,
yahoo : syedamjad6736@yahoo.com, skype : syedamjad.0786.
Please use Marked as Answer if my post solved your problem and use Vote As Helpful if a post was useful.Wednesday, June 12, 2013 2:20 PM