title: Database call vs Passing attributes in ASP.NET AJAX Web Service
body: <p>I have a food menu application with many food items. Each item has several options which I provide via radio and check buttons. Each button has attributes (i.e., name, code, database id, etc.).</p>
  
  <p>Right now, when the user selects a food item, my jquery code calls a server side Web Service that makes database calls to generate and return the HTML for the buttons and their attributes for the food item. </p>
  
  <p>Radio and Check Button examples:</p>
  
  <pre><code>&lt;input type="radio" value='6 inch:6":538:0.00:116:152:False' /&gt;
  
  &lt;input type="checkbox" itemid="152" abbreviation="HP" additionalcost="0.50" ingrdname="Pepper Jack" stdingrd="False" ingid="428" inggroupid="74" /&gt;
  </code></pre>
  
  <p>When the user clicks the buttons to customize the food item and adds the item to their order, the jquery code generates a big string with the button attribute values and sends it to the Web Service that parses the string and adds the info to the database.</p>
  
  <p>The part of the string for the above button examples would look like this:</p>
  
  <pre><code>[6 inch:false:116:538:6":False,Pepper Jack:true:74:428:HP:False]
  </code></pre>
  
  <p>So all the attribute info is passed back and forth. Of course, the number of buttons for the user is very big.</p>
  
  <p>Question:
  Should I keep this like it is, or should I just pass a minimal amount of info back and forth (i.e. database id and checked or not checked) , and make additional database calls back on the server to get the needed attribute info when the user adds the item to the order? </p>
  
  <p>All thoughts welcomed.</p>