Hi ramco1917,
You can not set focus to a control thats not visible and enabled.
You have to use JavaScript or jQuery to set focus to the TextBox.
Use below script to focus to the TextBox.
<script type="text/javascript" src="https://code.jquery.com/jquery-3.2.1.slim.min.js"></script>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" />
<script type="text/javascript" src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/js/bootstrap.min.js"></script>
<script type="text/javascript">
$(function () {
$('.modal').on('shown.bs.modal', function () {
$(this).find('[autofocus]').focus();
});
});
</script>