Assuming you're using IIS, look at HTTP Basic authentication configuration for that kind of requirment.
Using that authentication, the user automatically will be prompted to enter user & password.
Take on account that this mechanism is considered as very week protection and you should integrate SSL (HTTPS) with that.
MSDN:
However, the disadvantage of Basic authentication is that it transmits
unencrypted base64-encoded passwords across the network. You should
use Basic authentication only when you know that the connection
between the client and the server is secure. The connection should be
established either over a dedicated line or by using Secure Sockets
Layer (SSL) encryption and Transport Layer Security (TLS). For
example, to use Basic authentication with Web Distributed Authoring
and Versioning (WebDAV), you should configure SSL encryption.