Click here to Skip to main content
15,891,828 members
Home / Discussions / ASP.NET
   

ASP.NET

 
GeneralRe: Forms Authentication and using Current User Credentials programmatically Pin
Antony M Kancidrowski29-Jul-09 3:37
Antony M Kancidrowski29-Jul-09 3:37 
GeneralRe: Forms Authentication and using Current User Credentials programmatically Pin
Mike Ellison29-Jul-09 5:49
Mike Ellison29-Jul-09 5:49 
Question[Message Deleted] Pin
bhavna432128-Jul-09 23:34
bhavna432128-Jul-09 23:34 
AnswerRe: asp.net3.5 Pin
SeMartens28-Jul-09 23:39
SeMartens28-Jul-09 23:39 
GeneralRe: asp.net3.5 Pin
bhavna432129-Jul-09 0:00
bhavna432129-Jul-09 0:00 
GeneralRe: asp.net3.5 Pin
SeMartens29-Jul-09 0:03
SeMartens29-Jul-09 0:03 
AnswerRe: asp.net3.5 Pin
Manas Bhardwaj28-Jul-09 23:51
professionalManas Bhardwaj28-Jul-09 23:51 
QuestionRetrieve Full Name from Active Directory Pin
sheebalam11128-Jul-09 22:17
sheebalam11128-Jul-09 22:17 
Im using this code to get and display FullNAme from Active Directory.
It works fine on my machine but when i upload it on the Server It give me following error
I try to change winNT into LDAP but no use on SERVER...

////////////
Error: System.Runtime.InteropServices.COMException (0x80072020): An operations error occurred. at System.DirectoryServices.DirectoryEntry.Bind(Boolean throwIfFail) at System.DirectoryServices.DirectoryEntry.Bind() at System.DirectoryServices.DirectoryEntry.get_AdsObject() at System.DirectoryServices.PropertyValueCollection.PopulateList() at System.DirectoryServices.PropertyValueCollection..ctor(DirectoryEntry entry, String propertyName) at System.DirectoryServices.PropertyCollection.get_Item(String propertyName) at _Default.GetFullName(String strLogin) in d:\inetpub\En.ASPETAR.Rel\QCD-Suggestions\Default.aspx.cs:line 60

//////////

protected void Page_Load(object sender, EventArgs e)
{


this.lblDOS.Text = DateTime.Now.ToShortDateString();
tbName.Text = GetFullName(Request.ServerVariables["LOGON_USER"].ToString());

}

private string GetFullName(string strLogin)
{
string str = "";

// Parse the string to check if domain name is present.
int idx = strLogin.IndexOf('\\');
if (idx == -1)
{
idx = strLogin.IndexOf('@');
}

string strDomain;
string strName;

if (idx != -1)
{
strDomain = strLogin.Substring(0, idx);
strName = strLogin.Substring(idx + 1);
}
else
{
strDomain = "MYDOMAIN NAME";
strName = strLogin;
}

DirectoryEntry obDirEntry = null;
try
{
obDirEntry = new DirectoryEntry("WinNT://" + strDomain + "/"+ strName);
System.DirectoryServices.PropertyCollection coll = obDirEntry.Properties;
object obVal = coll["FullName"].Value;
str = obVal.ToString();
return str;
}
catch (Exception ex)
{
str = "";
return "Error: " + ex;
}

}

sheeba

AnswerRe: Retrieve Full Name from Active Directory Pin
Abhijit Jana28-Jul-09 23:00
professionalAbhijit Jana28-Jul-09 23:00 
GeneralRe: Retrieve Full Name from Active Directory Pin
sheebalam11129-Jul-09 1:35
sheebalam11129-Jul-09 1:35 
GeneralRe: Retrieve Full Name from Active Directory Pin
Abhijit Jana29-Jul-09 1:50
professionalAbhijit Jana29-Jul-09 1:50 
QuestionCreate a Floating Form Pin
mehrnoosh28-Jul-09 22:08
mehrnoosh28-Jul-09 22:08 
AnswerRe: Create a Floating Form Pin
Christian Graus28-Jul-09 22:14
protectorChristian Graus28-Jul-09 22:14 
GeneralRe: Create a Floating Form Pin
mehrnoosh28-Jul-09 22:50
mehrnoosh28-Jul-09 22:50 
AnswerRe: Create a Floating Form Pin
Abhijit Jana28-Jul-09 22:57
professionalAbhijit Jana28-Jul-09 22:57 
Questionperform custom paging in gridview on a button click Pin
smiley_jatin28-Jul-09 22:07
smiley_jatin28-Jul-09 22:07 
AnswerRe: perform custom paging in gridview on a button click Pin
Christian Graus28-Jul-09 22:15
protectorChristian Graus28-Jul-09 22:15 
GeneralRe: perform custom paging in gridview on a button click Pin
smiley_jatin29-Jul-09 0:30
smiley_jatin29-Jul-09 0:30 
QuestionCustom Paging in GridView Pin
.NET- India 28-Jul-09 21:55
.NET- India 28-Jul-09 21:55 
Questionfixed headers Pin
indian14328-Jul-09 21:50
indian14328-Jul-09 21:50 
AnswerRe: fixed headers Pin
Ravindra Bisen28-Jul-09 23:25
Ravindra Bisen28-Jul-09 23:25 
GeneralRe: fixed headers Pin
indian14328-Jul-09 23:31
indian14328-Jul-09 23:31 
AnswerRe: fixed headers Pin
Ravindra Bisen28-Jul-09 23:54
Ravindra Bisen28-Jul-09 23:54 
GeneralRe: fixed headers Pin
indian14329-Jul-09 1:13
indian14329-Jul-09 1:13 
GeneralRe: fixed headers Pin
indian14329-Jul-09 2:59
indian14329-Jul-09 2:59 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.