.net - HttpContext.Current.Request.LogonUserIdentity.IsAuthenticated Returns False Even Though The User Has Successfully Logged In?

Apr 10, 2011

2003I've implemented Forms Authentication on one particular subfolder on one of my sites. My code works perfectly on my development machine, but there is a slight problem on the live server.If you browse to the admin subfolder, if you are not authenticated, you will be redirected to the login page. The Master Page footer also contains a link to the login page; when the user logs in, that link is supposed to change to a link to the admin page:

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim link As HtmlAnchor = FindControlIterative(Me, "Login")
If HttpContext.Current.Request.LogonUserIdentity.IsAuthenticated Then

[code]....

This works fine on my dev PC, but on the live server, IsAuthenticated() returns False, and thus the Login link is not replaced by the Admin link. However, if browse to the admin subfolder, I can access the content fine; there is no redirection to the login page.

View 2 Replies


ADVERTISEMENT

Request.LogonUserIdentity.Name Returns Asp.net Server Credential Not The Users Credetials

Feb 15, 2011

I am building a simple intranet site and want to get the employees user name, but when i use Request.LogonUserIdentity.Name , i keep getting the servers credentials and not the users. what am i doing wrong and is there a better way to do this.

View 1 Replies

Display The Current User Logged In ?

Aug 15, 2011

i have a problem with my project.in one form i have 2 textboxes in one i have displayed the serial number.in the second i want display the current user logged on software.how can i display the current user logged in ????? the code for the serial number is :[code].....

View 2 Replies

Get UserID Of Current User Logged In From Server Using Program?

Aug 3, 2009

How to get userID of current user logged in from server using asp.net vb?

View 2 Replies

Display Current Logged User Data In Aspx Webpage?

Oct 31, 2011

I wanted to display my current logged user data in my aspx web page.But I am unable to do so. I just can't understand how to call the necessary data. I have used Grid view but I cannot find a query that will give me the details of the current logged user.

Code:
HttpContext.Current.User.Identity.Name

but it gives me an error saying "property access must assign to the property or use its value". I don't know how to tackle this.

View 1 Replies

Populate Active Directory Logged In Current User's Name Into Text Box Field?

Apr 15, 2011

Background: I have a webForm app that registers a user in the database based on the information provided with a web service, auto-generates a random password and username, and e-mails the user a link to take an application based on the marketing company selected.

Question: How do I populate the MarketerName_TextBox field with the currently logged in users name (Is it User.Identity.Name and do I add that line on aspx.vb end or the aspx end?)

[Code]...

View 2 Replies

Asp.net - LDAP User Attribute Request Returns Unusual Results?

May 31, 2012

I'm struggling to return user details from AD using LDAP, after i have authenticated that the user exists. I am using a simple auth method as follows:

Function AuthenticateUser(path As String, user As String, pass As String) As Boolean
Dim de As New DirectoryEntry(path, user, pass, AuthenticationTypes.Secure)
Try
Dim ds As DirectorySearcher = New DirectorySearcher(de)
Dim result As SearchResult = ds.FindOne()

[Code]...

the problem is that "distinguishedName" returns "DC=our-domain,DC=co,DC=uk" and "name" returns just "our-domain", not the name of the user that has just been auth'ed

Note: the displayName.text outputs are purely for debug purposes.I have tried various combos of requests but nothing seems to return USER details. ETA: to the security police: this is all within a https connection, I'm not sending passwords about in plain text!

View 1 Replies

Return Primary Email Address Associated With Logged On User's Current Outlook Profile?

Dec 6, 2009

I know, it's a bit weird asking for a query to tell me my own email address right, I'll explain further...

I'm writing a COM add-in for Outlook 2007. One of the subs generates and sends an email to a particular address and this all works fine.However I have a need to have an option for the sender to be able to include themselves on the recipients list.As more than one person will be running this I cannot just set the sender's email address manually and would prefer to just add a check box on the form to enable this feature.

The only bit I'm stuck on is working out how to find the email address of the person sending the email. I could do it with an AD query against the logged on user but this needs to work for non-domain users also so need another method.

View 3 Replies

My.User.IsAuthenticated Bug In WPF?

Nov 24, 2009

Create a WPF Windows Application Project in VB.NET (don't create, just keep reading this, unless you don't believe me...) Click the Window's header to create a Window.Loaded event-handler and to navigate to it.

Add the following to the event-handler:
My.User.CurrentPrincipal = New GenericPrincipal( _
New GenericIdentity("username"), Nothing)
Dim authenticated = My.User.CurrentPrincipal.IsAuthenticated

[code]....


UPDATE: I reported a bug at: [URL]

View 1 Replies

Use Server.MapPath When HTTPContext .Current Is Nothing?

Jan 20, 2011

I have some code that works fine when I need to delete some image files from a directory on my web server:

Dim ImageURL As String = dsImages.Tables(0).Rows(iImgRow).Item("ImageURL")
Dim physicalName = Server.MapPath(ImageURL)
oUpload.DeleteFileFromServer(physicalName, iAdid, iImgID)

[code].....

View 1 Replies

Asp.net - List Of Object In Httpcontext.current.cache

Jul 6, 2009

Is there a way to look through the cache for all objects in the cache? I'm dynamically creating objects and I need to periodically go through the list to purge out objects I'm no longer using.

View 6 Replies

.net - Initiate The Current Httpcontext When Accessing An Asp.net Library From A Service?

Jul 27, 2011

I have an asp.net project that's compiled on a server. On that same server I have a windows service that's running methods referenced from the asp.net .dll. Everything works fine except for when the httpcontext.current object needs to be accessed. I'm fairly certain that the cause of the .current being null is that it's referencing the shared library without an actual instance of the site running. In a previous version of the service I was able to find a workaround in asp.net by not using the context, however that is now a last resort as much of the architecture of the site has changed. Is there anyway to create an instance of the site and simulate a current httpcontext for the purposes of the service?

View 2 Replies

C# - Check If HttpContext.Current.Response Have An Existing Header?

Jun 19, 2012

I was working on a scenario where I have to add header to the Response Header.

I added a Response Header like this:- HttpContext.Current.Response.AddHeader("key1", "value1")

After some functional flow I required to add value to same "key1": HttpContext.Current.Reponse.AddHeader("key1, "value2")

thus value in Response Headers look like this:- key1 : value1, value2

I want to avoid the value2 addition to the same keyword key1.

I tried:-

If HttpContext.Current.Response.Headers("key1") Then
HttpContext.Current.Reponse.AddHeader("key1, "value2")
EndIf

But I got the error: This operation requires IIS integrated pipeline mode at HttpContext.Current.Response.Headers("key1")

I have IIS6 running. This [URL] says that it doestn't works if its not IIS7

View 1 Replies

Returns Value As True And False?

Sep 18, 2010

I am writing the code in the class to create the strings. I want the value to returns as true if the strings in the class are matched with two numbers or more, but if the if the strings in the class are not matched with first two numbers or not then returns the value as false.[code]....

View 4 Replies

DataSet.HasChanges Always Returns False?

Aug 13, 2010

I tied a text box to dataset using the following code

tbAddr.DataBindings.Add("Text", dsCust, "SYS_CUSTOMER.Address");
gridview to same dataset using
dgvNames.DataSource = customerBindingSource - this is in property box.
customerBindingSource.DataSource = dsCust.Tables["SYS_CUSTOMER"];

i make changes in text box tbAddr update_click () in this method i use the following code

[Code]...

View 1 Replies

VS 2008 IsDate Always Returns False

Jan 30, 2010

Was wondering why the IsDate function always returns false.

dim myYear as string
myYear = trim(txtYear.text)
If isYear(myYear) = false then

[code].....

View 8 Replies

List.Contains Returns False, Even Though It Seems It Should Return True?

Feb 17, 2010

Sub pageload() Handles Me.Load
Dim bom As New List(Of Car)
Dim car1 As New Car With {.Name = "Pea", .Year = 2}[cod

WHY??? I mean the object has the exactly same data, so why does itee]..... say it is not contained?

View 3 Replies

Directory.exists(UNCSpec) Always Returns False?

Jun 23, 2010

I am developing a Windows Service (Yes, windows service) using VB2008 and am having trouble determining whether a remote folder exists.The IF in question goes something like this:

If NOT system.io.directory.exists(strFolder) then
System.io.directory.createdirectory(strFolder)
End if

The problem is that the above test (excluding the NOT) always returns False, regardless of whether the folder exists or not. So, even if the folder exists, the next statement tries to create an already existing folder which does not go well.

The weird part(s) - after some tests

The system.io.directory.exists() works well when I type it in the immediate window for both local and network resources
It also works well when it is within a normal app (that is, not a service) regardless of whether it is local or network resource
The exists() method when in the service works well if the folder being tested is on the local machine, but fails when it is remote network resource, regardless of whether it is a true UNC or a mapped drive.It is not user's rights, as I have tested with both my own user and the localsystem user and have tested with network resources where I do have access rights.When I try to debug, the PC starts playing the Twilight Zone Theme (Ok, I am kidding about this one )Doing some searching I found that others are complaining about the same behavior, but no suitable answer has been found.

View 4 Replies

Function Returns True But Then It Becomes False Upon Assignment

Dec 7, 2010

I call a function (SaveChanges) to access my business / data layer and save any changes to fields that are marked as an Add or Update and are marked to be processed. This function used to work fine up until 60+ minutes ago. What is happening is that suddenly the function is returning false. After debugging through the code, when it hits Return the local boolean is set as True but when it gets back to the calling method (and uses the return value) it is now False. As I said I went through line by line and debugged it, then I added a watch to it. The funny part is that there is one spot that sets the Boolean to false, and when I put a breakpoint on that spot it is never reached.

Here is the function:
Private Function SaveChanges() As Boolean
Dim blnSaved As Boolean = True
Dim saveableRows As List(Of DataRow) = (From d As DataRow In _listData.Tables(0).Rows _
Where Not d("Marking") = "Duplicate" _
And d("Process") = True _
[Code] ....

View 4 Replies

Game Programming :: Function Always Returns False?

Oct 3, 2009

[VB.Net 2008 Express Edition]I have a 2D array of Integers called Map(0 to 79, 0 to 79)In this array I store IDs for tiles to be loaded later.I'm trying to write a module to generate a random dungeon every time it starts by making a room 10x10 tiles in the middle, picking a wall, making a hallway from that wall, and adding a room to the end of that hallway.From there it picks a random wall anywhere in the map, adds a hallway and a room, and repeats until the number of floor tiles is high enough [400 atm] The problem is that when the rooms and hallways are made, it first runs a function to return whether or not that space is empty. The problem is that even when I know for a fact the space is empty, it returns false. I don't understand why. Here's the Clear function.

Code:
Public Function Clear(ByVal Top As Integer, ByVal Left As Integer, ByVal Height As Integer, ByVal Width As Integer) As Boolean
'Returns whether a rectangle is empty
'used to loop through a rectangle of the map array
Dim introw As Integer

[code]....

View 5 Replies

Public Function Returns Boolean True Or False

Jul 28, 2011

I have a math program that I am working on. One of the exercises has a random word and 6 radiobuttons. The user has to select the radiobutton that displays the exact number of letters in the random word. What I am having trouble with is creating a Public Function to check if the answer selected is the correct one. The radio buttons are within a groupbox. The Public Function returns a boolean True or False.

View 4 Replies

InvokeRequired Returns False When UpdateLabel Function Is Called From A Different Class?

May 10, 2012

I am working with tasks, so I've got the following code to update a label on my form:

Private Delegate Sub UpdateLabelDelegate(ByVal s As String)
Public Sub UpdateLabel(ByVal s As String)
If Me.InvokeRequired Then

Me.BeginInvoke(New UpdateLabelDelegate(AddressOf UpdateLabel), New Object() {s})
Return

View 2 Replies

Asp.net - Request Function Returns Null In Firefox/Chrome?

Apr 25, 2011

I have a several form elements that I am dynamically creating with javascript when a user changes a number value in a textbox, by filling the innerHTML of a div like so:

dfinnerhtml = dfinnerhtml + "<div class='field'> ";
dfinnerhtml = dfinnerhtml + "<textarea name='textbox1" + suffix + "' type='text' id='textbox1" + suffix + "' value='' rows='4' cols='20' class='field'></textarea> ";
dfinnerhtml = dfinnerhtml + "</div> ";

Then, in the aspx.vb code behind, when the user clicks the Save button, I run through a series of Requests to try and add the values that are in these form elements to a SQL string:

Dim DFTestValue1 As String DFTestValue1 = Request("textbox" & c.ToString)

where c is a loop counter to the # of textboxes created (the input value mentioned above that triggers the create) The problem here is that this code works in Internet Explorer but not in Firefox or Chrome. The Request() value returns null and nothing is saved. I hope I've explained this well enough.

View 2 Replies

VS 2008 Program Requests A Password If Its False It Returns Noturous 'failed To Login'

Feb 15, 2010

I'm trying to compare something the user sends to a listview(first column) to see if it can find a match using [code] and if it equals true the program requests a password if its false it returns the noturous "failed to login"

View 2 Replies

Get The WindowsIdentity Object For Logged-on User In An Application Running As Another User?

Jul 18, 2011

I'm running an application under an account that is not the account logged-on to the PC.

Within the application I need check if the logged-on user is a member of the Administrators group. Below is the code I'm using. From what I've read, WindowsIdentity.GetCurrent() should return an object associated with the logged-on user. It doesn't, it returns the same information as the call to System.Threading.Thread.CurrentPrincipal. Which is the information associated to the ID running the application, not the logged-on user.

[Code]...

View 8 Replies

Sending Multi-threaded SendEmail Request Returns General Mapi Failure

Mar 5, 2009

I'm using the MAPI code by Dave Brooks.I am attempting to programatically send out a Crystal Report that is generated.When I run through the code without threading everything runs fine. The problem is when I use threading I get the return error "General MAPI failure [2]".I have never used threading before and understand that there are dangers involved. Can anyone provide any insight into this issue? NOTE: I've removed exception handling to make the code clearer.[code]

View 1 Replies

DateTimePicker Control That Returns Current Date

Dec 28, 2008

I have a DateTimePicker control that returns the current date.My usage is like this: DateTimeInput.Value.ToString("MMMM dd, yyyy")Please note that I need to get the date in the specified format.I just don't know how to add 1~2 years to the date.I mean if user selected January 01, 2009, I want to get January 01, 2010.So how can I add just 1 year or 2 years to the year of returned value?

View 3 Replies

C# - Check If User Is Logged In?

Dec 5, 2010

I am using Microsoft visual basic 2010 for a asp.net site using c#.I am using the asp.net configuration for user registration. I have a comments form which I want to appear only if a user is logged in.I now there is a toolbox helper thing called Login View which does exactly what I want but as soon as I put a form inside the code won't compile because it cannot find the textbox fields.

I have the following in NewsArticle.aspx:

<asp:LoginView ID="LoginView1" runat="server">
<AnonymousTemplate>
<div class="postcomment">

[code]....

If I take the form out of asp:LoginView it works fine. Inside I get the following:

Error 2 The name 'txtTitle' does not exist in the current context NewsArticle.aspx.cs 59 53 Figmentville
Error 3 The name 'txtComment' does not exist in the current context NewsArticle.aspx.cs 59 68 Figmentville

View 1 Replies

Get The Logged-in User From ASP.NET Membership?

Dec 12, 2009

(I work on VS 2005 with Access Database and C#)

I have my code as follows:

protected void Page_Load(object sender,
System.EventArgs e)
{

[Code]....

The logged-in 'UserId' and 'UserName' is getting displayed correctly, but now how do I use the string 'lmember' in my 'SELECT' statement when I need to display the related information from the table 'aspnet_Users' for the logged-in user? getting the following select statement:

SelectCommand="SELECT * FROM aspnet_Users WHERE (UserName= ????)"

View 1 Replies

Logged In User Information?

Jul 20, 2009

I'm writing software in VB .NET (2005) which uses the Windows user information as login credentials - just the username. I've found Environment.UserName which works for the username (as you would expect).However, I need more information - I need the full name of the user (as shown on the Start Menu). It seems this information is stored... somewhere, as Windows is able to use it for things like permissions on file shares.

View 1 Replies







Copyrights 2005-15 www.BigResource.com, All rights reserved