title: ASP.NET MVC Sharing data between scripts in partial view and host view
body: <p>I have a scenario where a script in a view makes an ajax request to the controller, and the controller will return one of several partial views, which is rendered in a div.</p>
  
  <p>Each of these partial views essentially relates to a type of response (i.e. Date, Phone Number, Radio Buttons, etc.) and therefore, the response value needs to be handled differently for each type.</p>
  
  <p>I have this notion of putting the javascript handling code in the partial view but with the same function name, and having the host view call the function (not knowing what type of response it is), then adding the results from the function to an array, before the combined array is posted back to the controller.</p>
  
  <p>Is this something that can be done? If not, what is a good way of approaching something like this? Could I otherwise push something into an array that's in a different script block on the host view?</p>