Click here to Skip to main content
16,007,885 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: Open File Dialog without html file field Pin
M LN Rao21-Oct-07 23:03
M LN Rao21-Oct-07 23:03 
Questionmaster page relating issue Pin
Sonia Gupta21-Oct-07 22:39
Sonia Gupta21-Oct-07 22:39 
AnswerRe: master page relating issue Pin
M LN Rao21-Oct-07 22:49
M LN Rao21-Oct-07 22:49 
AnswerRe: master page relating issue Pin
Guffa21-Oct-07 22:52
Guffa21-Oct-07 22:52 
AnswerRe: master page relating issue Pin
Aavesh Agarwal21-Oct-07 22:56
Aavesh Agarwal21-Oct-07 22:56 
GeneralRe: master page relating issue Pin
M LN Rao21-Oct-07 22:57
M LN Rao21-Oct-07 22:57 
AnswerRe: master page relating issue Pin
John-ph21-Oct-07 23:23
John-ph21-Oct-07 23:23 
Questionwhere is wrong ? Pin
asifbhura21-Oct-07 22:24
asifbhura21-Oct-07 22:24 
Hi,

I am developing intranet website.it automatically takes username as user logs in to system using active directory.

using User.Identity.Name and gives msg to user as welcome Mr. to our Intranet application.

this entire application is under inetpub/wwwroot in my system.it is not on server.

My computer name is bhuraa.

now, i tried it to start from another computer using http://bhuraa/intraApplication.

It works absolutely fine.even displays welcome msg as per system username.

But now the problem is here.

I am trying to fetch user information from active directory.User already logged in.

It works fine only on my pc(system). I tried it from another computer.it doesnt work.even using another username or my username.

so, please help me out where could be wrong ? i need to configure something ?

code is below,

I couldn't understand.it works on my computer.and not working on aonther computer.
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

lblmail.Text = GetUserInfo(User.Identity.Name, "mail")
lblgn.Text = GetUserInfo(User.Identity.Name, "givenName")

lblsn.Text = GetUserInfo(User.Identity.Name, "sn")
lbllocation.Text = GetUserInfo(User.Identity.Name, "l")

lblstAdd.Text = GetUserInfo(User.Identity.Name, "streetAddress")
lblzip.Text = GetUserInfo(User.Identity.Name, "postalCode")

lbltel.Text = GetUserInfo(User.Identity.Name, "telephoneNumber") lblcountry.Text = GetUserInfo(User.Identity.Name, "co")
End Sub

Public Function GetUserInfo(ByVal inSAM As String, ByVal inType As String) As String

Try

'Dim objsearch As DirectorySearcher = New DirectorySearcher()

'Dim strrootdse As String = objsearch.SearchRoot.Path

Dim sPath As String = "LDAP://RCJY01DC01"

' Dim uname As String = Request.ServerVariables("REMOTE_USER")

Dim SamAccount As String = Right(inSAM, Len(inSAM) - InStr(inSAM, "\"))
Dim myDirectory As New DirectoryEntry(sPath)

Dim mySearcher As New DirectorySearcher(myDirectory)
Dim mySearchResultColl As SearchResultCollection

Dim mySearchResult As SearchResult Dim myResultPropColl As ResultPropertyCollection
Dim myResultPropValueColl As ResultPropertyValueCollection

mySearcher.Filter = ("(&(objectClass=user)(samaccountname=" & SamAccount & "))")
mySearchResultColl = mySearcher.FindAll()

Select Case mySearchResultColl.Count Case 0
Return "Null"

Exit Function

Case Is > 1
Return "Null"

Exit Function

End Select

mySearchResult = mySearchResultColl.Item(0)

myResultPropColl = mySearchResult.Properties

myResultPropValueColl = myResultPropColl.Item(inType)

Return CStr(myResultPropValueColl.Item(0)) Catch ex As System.Exception
End Try

End Function

AnswerRe: where is wrong ? Pin
M LN Rao21-Oct-07 22:46
M LN Rao21-Oct-07 22:46 
QuestionHow to use CSS with Web User Control? Pin
bug_aonz21-Oct-07 22:18
bug_aonz21-Oct-07 22:18 
AnswerRe: How to use CSS with Web User Control? Pin
Guffa21-Oct-07 22:23
Guffa21-Oct-07 22:23 
QuestionFinding a Textbox value inside a DataGrid using JAVASCRIPT Pin
jaishankar270421-Oct-07 22:16
jaishankar270421-Oct-07 22:16 
AnswerRe: Finding a Textbox value inside a DataGrid using JAVASCRIPT Pin
Spunky Coder21-Oct-07 22:28
Spunky Coder21-Oct-07 22:28 
QuestionDropdown Menus In ASPX Pin
matjame21-Oct-07 22:07
matjame21-Oct-07 22:07 
AnswerRe: Dropdown Menus In ASPX Pin
Christian Graus21-Oct-07 23:03
protectorChristian Graus21-Oct-07 23:03 
GeneralRe: Dropdown Menus In ASPX Pin
matjame23-Oct-07 0:59
matjame23-Oct-07 0:59 
QuestionPlace Holder Pin
.NET- India 21-Oct-07 21:49
.NET- India 21-Oct-07 21:49 
AnswerRe: Place Holder Pin
Paddy Boyd21-Oct-07 22:06
Paddy Boyd21-Oct-07 22:06 
GeneralRe: Place Holder Pin
.NET- India 21-Oct-07 22:43
.NET- India 21-Oct-07 22:43 
GeneralRe: Place Holder Pin
Paddy Boyd21-Oct-07 23:27
Paddy Boyd21-Oct-07 23:27 
GeneralRe: Place Holder Pin
.NET- India 22-Oct-07 0:15
.NET- India 22-Oct-07 0:15 
GeneralRe: Place Holder Pin
Paddy Boyd22-Oct-07 0:18
Paddy Boyd22-Oct-07 0:18 
GeneralRe: Place Holder Pin
.NET- India 22-Oct-07 0:28
.NET- India 22-Oct-07 0:28 
Questiontwo form tags Pin
Sonia Gupta21-Oct-07 21:49
Sonia Gupta21-Oct-07 21:49 
AnswerRe: two form tags Pin
Spunky Coder21-Oct-07 21:56
Spunky Coder21-Oct-07 21:56 

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.