I'm very new to the world of jQuery and might be asking a fairly trivial question here. I'm curious as to what the community views as the best practice for a databound object with jQuery functionality.
As a specific example, I've currently created a repeater bound to a list of objects. Each object has properties such as "link", "thumbnail", "subtext", etc. This is a small repeater(<10 items at any time). When a user clicks on "link", a separate area of the page updates to reflect that object.
The approaches I've discovered so far involve:
- Dynamically creating the necessary jQuery script from the C# codebehind
- Creating a JSON service to respond to the link request and return the object to be loaded(an extra possibly unnecessary database hit)
- To dynamically create a JS Struct within the C# codebehind (similar struct)
I guess the main reason I have for avoiding a JSON service in this scenario, is that the objects have already been bound once after being returned from the datasource. I'm not sure if another db hit is warranted, but I'm open to any and all suggestions.