Login dialog when using the Team Foundation Server API
nwc = new NetworkCredential(tfsuid, TFSPass, TFSDomain);
tfs = new TeamFoundationServer(TFSServerUrl, new UICredentialsProvider());
tfs.EnsureAuthenticated();
EnsureAuthenticated does not work for web,You need to have customize dialog box to accept uid and password.
Few use full links for above topic…
http://blogs.msdn.com/buckh/archive/2006/03/17/credentialprovider.aspx
http://social.msdn.microsoft.com/forums/en-US/tfsgeneral/thread/b6d8c69f-655f-4391-bda1-f3fefa7d54f3/
http://blogs.msdn.com/narend/archive/2006/07/29/682032.aspx
http://blogs.msdn.com/kannans/archive/2007/04/23/tfs-data-source-asp-net-control.aspx
Good luck..