append html in the td
like this:
<td id="partialcontainer">
<% Html.RenderPartial("ViewUsersInRole");%>
</td>
and append html in it:
$(document).ready(function () {
$('#UserListForRoleView').change(function () {
var selectedID = $(this).val();
$.get('/UserAdminRepository/ViewUsersInRole/?user=' + selectedID,function(response){
$('#partialcontainer').html(response);
})
});
});
Little Improved code, always use Url.Action
to generate url:
$(document).ready(function () {
$('#UserListForRoleView').change(function () {
var selectedID = $(this).val();
var url = '@Url.Action("ViewUsersInRole","UserAdminRepository")';
url+"?user="+selectedID;
$.get(url,function(response){
$('#partialcontainer').html(response);
});
});
});
I have modified a little your code to make it more clear and readable.