Hi praveenapk,
Since OnSelectedIndexChanged page got post back. So the selected time is lost.
To retain the value you need to use HddenField and set HddenField value on DropDownList change and on page load reset the selected time using jQuery.
Refer below sample.
HTML
<asp:HiddenField ID="hfTime" runat="server" />
<input type="time" id="txtTime1" class="form-control" />
<asp:DropDownList runat="server" AutoPostBack="true" OnSelectedIndexChanged="OnSelectedIndexChanged" onChange="SetTime()">
<asp:ListItem Text="text1" />
<asp:ListItem Text="text2" />
</asp:DropDownList>
<script type="text/javascript" src="https://ajax.googleapis.com/ajax/libs/jquery/1.8.3/jquery.min.js"></script>
<script type="text/javascript">
$(function () {
if ($('#hfTime').val() != '') {
$("#txtTime1").val($('#hfTime').val());
}
});
function SetTime() {
var time = $("#txtTime1").val();
$('#hfTime').val(time);
}
</script>
Code
C#
protected void OnSelectedIndexChanged(object sender, EventArgs e)
{
// Rest Task.
}
VB.Net
Protected Sub OnSelectedIndexChanged(ByVal sender As Object, ByVal e As EventArgs)
' Rest Task.
End Sub