.NET Framework - Use of Login Control
Asked By ChaplainDou
13-Aug-07 11:02 AM
Visual Studio 2005 Express. I would like to have the login control validate
logins using Active Directory. That is, I would like to have user logins
checked against the AD in our server (Windows Server 2003). How may I
accomplish this?
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org
Windows Server 2003
(1)
Windows 2003 Server
(1)
Visual Studio 2005
(1)
Active Directory
(1)
Server.HtmlEncode
(1)
ASP.NET
(1)
VB.NET
(1)
Response.Write
(1)
ChaplainDou replied...
Please allow me to clarify.
I just downloaded Visual Web Developer 2008 Express. I am experimenting and
trying to learn.
I want to put a Login control on a page and have that control check the user
name and password against my Active Directory on our Windows 2003 Server.
How may I accomplish that?
If anyone could provide some examples with code it would be great. Thanks
and God bless.
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org
ManishBafn replied...
Hi,
This is actually easy to-do with ASP.NET 2.0 using the
ActiveDirectoryMembership provider. Below msdn link describes how to do it:
http://msdn2.microsoft.com/en-us/library/ms998360.aspx
--
Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.
ChaplainDou replied...

Thank you for the help. I have a question regarding the information to which
you directed me. I am instructed:
Add a Page_Load Event Handler
Add the following code to the Page_Load event handler of your Default.aspx
page. This page should be displayed only to authenticated users. To prove
that this is the case, the code displays information obtained from the forms
authentication ticket that is issued to authenticated users.
protected void Page_Load(object sender, EventArgs e)
{
Response.Write("Hello, " + Server.HtmlEncode(User.Identity.Name));
FormsIdentity id = (FormsIdentity)User.Identity;
FormsAuthenticationTicket ticket = id.Ticket;
Response.Write("<p/>TicketName: " + ticket.Name );
Response.Write("<br/>Cookie Path: " + ticket.CookiePath);
Response.Write("<br/>Ticket Expiration: " +
ticket.Expiration.ToString());
Response.Write("<br/>Expired: " + ticket.Expired.ToString());
Response.Write("<br/>Persistent: " + ticket.IsPersistent.ToString());
Response.Write("<br/>IssueDate: " + ticket.IssueDate.ToString());
Response.Write("<br/>UserData: " + ticket.UserData);
Response.Write("<br/>Version: " + ticket.Version.ToString());
}
I assume that this is aspx code. Where do I place this in the default.aspx
file?
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org
ManishBafn replied...
Hi,
You will find Page_Load event in Default.aspx.cs(if language selected is C#)
or in Default.aspx.vb(if language selected is VB.NET).When you double click
Default.aspx in design mode you will get Default.aspx.cs. or Default.aspx.vb.
--
Hope this helps.
Thanks and Regards.
Manish Bafna.
MCP and MCTS.
ChaplainDou replied...

Dear Manish:
I tried plugging the code into the default.aspx.vb and it would not work. I
was able to kludge it and have some of it work. The code below is what I
produced. All the commented lines errored out. What am I missing? Is the
example text C# code? How do I then reference in vb the items that errored
out?
Protected Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
Handles Me.Load
Response.Write("Hello, " + Server.HtmlEncode(User.Identity.Name))
'FormsIdentity id = (FormsIdentity)User.Identity;
'FormsAuthenticationTicket ticket = id.Ticket;
'Response.Write("<p/>TicketName: " + ticket.Name );
'Response.Write("<br/>Cookie Path: " + ticket.CookiePath);
'Response.Write("<br/>Ticket Expiration: " +
' ticket.Expiration.ToString());
'Response.Write("<br/>Expired: " + ticket.Expired.ToString());
'Response.Write("<br/>Persistent: " + ticket.IsPersistent.ToString());
'Response.Write("<br/>IssueDate: " + ticket.IssueDate.ToString());
'Response.Write("<br/>UserData: " + ticket.UserData);
'Response.Write("<br/>Version: " + ticket.Version.ToString());
End Sub
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org
ChaplainDou replied...
Dear Manish:
I am using the Active Directory to authenticate logins. The logins are in
two folders, one called "Users" and the other called "Mail_Users." How can I
get the code to search for the logins in either or both folders? The
following is what I have:
connectionString="LDAP://goodnewsjail.org/CN=Users,DC=goodnewsjail,DC=org" />
When I try "CN=Mail_Users" I get an error. What am I doing wrong?
--
Dr. Doug Pruiett
Good News Jail & Prison Ministry
www.goodnewsjail.org
Stevanich replied...
Doug,
The supplied code is in fact C# code. The VB.NET equivalent is:
Response.Write("Hello, " & Server.HtmlEncode(User.Identity.Name))
Dim id As FormsIdentity = CType(User.Identity, FormsIdentity)
Dim ticket As FormsAuthenticationTicket = id.Ticket
Response.Write("<p/>TicketName: " & ticket.Name)
Response.Write("<br/>Cookie Path: " & ticket.CookiePath)
Response.Write("<br/>Ticket Expiration: " & _
ticket.Expiration.ToString())
Response.Write("<br/>Expired: " & ticket.Expired.ToString())
Response.Write("<br/>Persistent: " & ticket.IsPersistent.ToString())
Response.Write("<br/>IssueDate: " & ticket.IssueDate.ToString())
Response.Write("<br/>UserData: " & ticket.UserData)
Response.Write("<br/>Version: " & ticket.Version.ToString())
Hope this helps,
Steve - dotneticated.com
Services Discussions NOVAS.NCOMPARE.V5.2.R12.for.LINUX (1) NASSDA.CRITIC.v5.0.01.2005.WINDOWS (1) GREEN.HILLS.Integrity.v5.0.6.RTOS.for.Blackfin (1) NASSDA.HANEX.v5.0.01.2005.WINDOWS (1) OPTIS.OPTISWORKS.STUDIO.v2008 (1) NASSDA.HSIM.v5.0.01 2005.WINDOWS (1) 2012 crack software5 download. Please press Ctrl+F to find your cracked software you Solidworks.eDrawings.Professional.2004.SP2.4.2.0. SolidWorks.Enterprise.PDM.v2010 Solidworks.PDMWorks.Workgroup.Server.V2008.SP2.1. SolidWorks.Premium.v2010.SP0.0.Finall.for.Win32.Multilanguage.DVD SolidWorks.Premium
form previous VS .NET Framework In the past converted an application written in an old (<2005) VS to VS 2005. Of the application I would like to change the layout. But it would appear that problem? It would be too much work to completely rewrite the application. Zach. C# Discussions Visual Studio (1) ComponentResourceManager (1) ContentAlignment (1) GraphicsUnit (1) EventHandler (1) FontStyle (1) CheckBox (1) TextBox (1) Is this a Windows Forms application? If so, there ishould be a region titled is not totally packed with InitializeComponent() { System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(InvoiceForm)); this.textBox17 = new System.Windows.Forms.TextBox(); this.textBox15 = new System.Windows.Forms.TextBox(); this.textBox7 = new System.Windows.Forms.TextBox(); this.textBox6 = new System.Windows.Forms.TextBox(); this.textBox5 = new System.Windows.Forms
Utf-8?Q?Depurando_aplicaci = C3 = B3n? = .NET Framework Hola a todos, tengo una aplicación windows vb.net vs 2005. Intento depurar la aplicación, pulsnado F5 para Debug, pero hasta que aparece el primer formulario a. Saludos y gracias de antemano 'AdministradorWin.exe': Loaded 'D: \ DESA \ ExpedienteElectronico \ Nivel Cliente \ Presentacion Windows \ Administrador \ bin \ Debug \ AdministradorWin.exe', No native symbols in symbol file. 'AdministradorWin.exe': Loaded 'C: \ WINDOWS \ system32 \ ntdll.dll', No symbols loaded. 'AdministradorWin.exe': Loaded 'C: \ WINDOWS \ system32 \ mscoree.dll', No symbols loaded. 'AdministradorWin.exe': Loaded 'C WINDOWS \ system32 \ kernel32.dll', No symbols loaded. 'AdministradorWin.exe': Loaded 'C: \ WINDOWS \ system32 \ advapi32.dll', No symbols loaded. 'AdministradorWin.exe': Loaded 'C: \ WINDOWS \ system32 \ rpcrt4.dll', No symbols loaded. 'AdministradorWin.exe': Loaded 'C: \ WINDOWS \ system32 \ shlwapi.dll', No
below) shows lot of messages Stepping over non-user code. Running in release mode from Windows this line speed is same (slow). How to speed up grid creation ? Using C# Express 2008 3.5 SP1 in Vista. Andrus. class Grid : System.Windows.Forms.DataGridView { internal void SetDataRetriever(DataRetriever<TEntity> dataRetriever) { . . . . . . SuspendLayout(); Enabled = false; int cnt = DataRetriever.RowCount if (!Enabled) return; . . . } } Debug output window contains: Step into: Stepping over non-user code 'System.Windows.Forms.DataGridView.RowCount.set' Step into: Stepping over non-user code 'System.Windows.Forms.DataGridViewColumn.CellTemplate.get' Step into: Stepping over non-user code 'System.Windows.Forms.DataGridView.CompleteCellsCollection' Step into: Stepping over non-user code 'System Windows.Forms.DataGridViewColumn.CellTemplate.get' Step into: Stepping over non-user code 'System.Windows.Forms.DataGridView.CompleteCellsCollection' Step into: Stepping over non-user code 'System.Windows.Forms.DataGridViewTextBoxCell.DataGridViewTextBoxCell' Step into: Stepping over non-user code 'System.Windows.Forms.PropertyStore.GetObject
s slows. . . I see, The application load many assemblies. . . many .Dll (for example, from system32 directory. . .), any help ? is it correct ?? Too there an error like this: Managed Debugging Assistant 'LoaderLock problem in Thanks in advanced !!! Greetings 'AdministradorWin.exe': Loaded 'D: \ DESA \ ExpedienteElectronico \ Nivel Cliente \ Presentacion Windows \ Administrador \ bin \ Debug \ AdministradorWin.exe', No native symbols in symbol file. 'AdministradorWin.exe': Loaded 'C: \ WINDOWS \ system32 \ ntdll.dll', No symbols loaded. 'AdministradorWin.exe': Loaded 'C: \ WINDOWS \ system32 \ mscoree.dll', No symbols loaded. 'AdministradorWin.exe': Loaded 'C WINDOWS \ system32 \ kernel32.dll', No symbols loaded. 'AdministradorWin.exe': Loaded 'C: \ WINDOWS \ system32 \ advapi32.dll', No symbols loaded. 'AdministradorWin.exe': Loaded 'C: \ WINDOWS \ system32 \ rpcrt4.dll', No symbols loaded. 'AdministradorWin.exe': Loaded 'C: \ WINDOWS \ system32 \ shlwapi.dll', No symbols loaded. 'AdministradorWin.exe': Loaded 'C: \ WINDOWS \ system32 \ msvcrt.dll', No