after some searching, got the way to do this and is working well
had set the authentication to windows in the webconfig and set up IIS to use basic windows authentication.
and it pulls out the username with the
and adding System.Web
tried using this after hosting it on the server and works well.