Try adding text box changed event with setting AutoPostBack="True" for the text box control.
<asp:TextBox CssClass="form-control" runat="server" MaxLength="7" ID="txtRollNo" OnTextChanged="txtRollNo_TextChanged" AutoPostBack="True" />
protected void txtRollNo_TextChanged(object sender, EventArgs e)
{
var employee = _service.GetEmployee(txtRollNo.Text);
if (employee != null)
{
MsgLitteral.ShowNotificationInline("Record Found", true);
}
else
{
MsgLitteral.ShowNotificationInline("Record not Found", false);
}
}
}