Make your dropdown like this: This is a sample code. Change it as your requirement. You can use JS like below to fill text box.
If you find help from this , please marked as answered.
@Html.DropDownList("jobID", null, new {@id="job"})
and taskname text box :
@Html.EditorFor(model => model.taskName, new {@id="taskname"})
Do like this, write jquery event for dropdown index change event, and send ajax call to get Task Name against the job Id selected from the dropdown list:
$('select#job').change(function(){
var JobId =$(this).val();
var Url = 'http://example.com/Controller/Action/?jobid='+JobId ;
$.ajax({
url: Url ,
success: function(result) {
$('input#taskname').val(result);
},
error: function(error) {
alert(errorss);
}
});
});