If i understand your question right , you want to pass an array to your controller so you can do like this
<script>
var _TempIds = [];
_TempIds["HospitalId"] = "1";
_TempIds["ClinicId"] = "2";
_TempIds["DoctorId"] = "3";
function fun()
{
$.ajax({
type: "POST",
cache: false,
url: "/Controller/Action",
dataType: "json",
traditional: true,
data: {
_TempIds: _TempIds
}
});
}
</script>
and in your controller you can access your array like this
public ActionResult Index(IEnumerable<string>_TempIds)
{
return View();
}
<pre lang="text">I hope this will help you
Cheers!!