.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Imran Ghani
Sohaib Khalid
Post New Web Links

Successful login redirects to directory listing

Posted By:      Posted Date: October 05, 2010    Points: 0   Category :ASP.Net

I have set the destinationpageurl of my login control to login.aspx. On successfully logging in to my website, I get redirected to the directory listing. Why is this? What am I doing wrong?

Also, what do I need to do to not allow the user to see the directory listing ever.

View Complete Post

More Related Resource Links

>>> Open a Popup window on Successful Login if something new added to website.

Hi, I would like to open a Popup window in Parallel if user Login successfully. The popup will give updates to the user that what's new added to the website. The popup will open only once if user login. If he logout and will re-login then it should not popup as we'll assume that he has been notified earlier. I have users table with user id's. It is for information that I am working in Framework 2.0 and not allowed to use any third party or AjaxToolkit. Therefore javascript or any other technique will resolve the issue. Any idea with coding example would be helpful.

Active Directory login

We will put the active directory logon when the user access the website, the user needs to fill in his user name and password.How do we store/get the details of the logon user once the user is logged in?

Create SQL Login that utilized Active Directory

Hello SQL Guru, I’m newbie to create SQL Login that utilized Active Directory. I have a SQL Server 2008 Enterprise edition 64-bits that runs in Window Server 2008 R2 Standard Edition 64-bit operating Systems. I configured  the SQL Server 2008 with Window Authentication. Then, I login with built-in Administrator account into computer and connected to my SQL Server 2008.  e.g: Object Explorer displayed COMPUTER NAME\Database Instance Name (SQL Server 10.0.2531 – COMPUTER NAME\Admin Account) Then, I created SQL login on the following: USE AccountingDatabase;GO CREATE USER  DomainName\User Name FOR LOGIN DomainName\User NameGO EXEC sp_addrolemember N’db_datareader’, N’DomainName\User Name’GO I tested it out and the specific login still did not have an access to specific database instance  e.g: “AccountingDatabase” Also, I did not see the “User Mapping” under properties checked/assigned to those specific user. Can anyone help and give me light on best practice. Thanks,Edwin

Directory Listing Denied

Hi,   After uninstalling and re-installing NET 2.0 (sp1) and 1.1 both Sharepoint 3.0 Central Administration and a sharepoint site show directory listing denied errors.   Surfing to http://site/ result in Directory Listing Denied (403) error. However, if I type the whole path http://site/default.aspx both central administration and the site is shown correctly.   After scanning google, I've seen several suggestions. Checking application pools (both central administration and the site have their own application pool owned by Network Service). Checking so execute permissions is script only and not executable (I've tried them all and on all subdirectories). Documents settings in IIS is default.aspx (don't think sharepoint listen to that though). They all fail. The problem is persistant.  I would really like to hear some suggestions how to fix this problem.

Small site embedded login validating against Active Directory and redrecting to SharePoint site


I am only finding pieces of this information. 

Challenge: Have a standard page with a login box in the corner that is exposed on the web.  The login will validate an employee against AD and also redirect them to a site collection.

I have found information on claims based authentication and the AD Membership provider.  I have also found information on form based login pages.  Most of these examples though just modify the SharePoint form login.  I want to create just a small login box on a page that is already created.  The one thing that I can't seem to find any really solid information on is the redirect to a site collection.

Can anyone tie all of this together for me?  Am I using the correct terminology and heading down the right path.

Any help is greatly appreciated.

Active Directory Authentication with Login Control ASP.Net 3.5 or 4


Hello, I am trying to follow instructions on how to create a login page that tests against active directory.  My issue is all of the tutorials seem to be written for ASP.NET 2.0.  When I try to follow them I cannot get them to work.  Does anyone have any tutorial or information for .NET 3.5 or 4.0?


Different login page for sub-directory



I'm building a small mobile portal for an existing site where users can log in and do things from mobile devices. Now, this portal sits in a sub-directory in the main site, with its own login page. How do I set the web.config to redirect users to this page instead of the normal login page to perform authentication?

I've tried using the <authentication> section in the web.config of the sub-directory, but obviously doesn't work, cannot use that section in a non-virtual directory.

changing active directory login name

So the guys at my company have been changing the AD login names for women that get married. For example Jenny Smith got married to Bob Right, AD\jsmith changes to AD\jright.  This doesn't cause any problems until we changed servers and used microsoft's login transfer script.  It scripts out Jenny's login as AD\jsmith, and then when you run the script it says:

Msg 15401, Level 16, State 1, Line 3
Windows NT user or group 'AD\jsmith' not found. Check the name again.

I know someone else has had to deal with this, is this just a bug?

also if i were to add AD\jright when AD\jsmith is already on the server it says AD\jright is already added to the security.

Login control displays error message even after successful login... How come?



I am using .net framework 2.0 witn C#. Am using the login and the CreateUserWizard and the situation is like this.

1) login.aspx page has the login control and i have a hyperlink on the same page saying 'sign up now' which when clicked redirects to the register.aspx page where i have place the createUserWizard control

2) As a new user i click on the 'sign up now' and register myself.

3) I come back to the login.aspx page and login with my new username & password.

It displays the following message 'Your login attempt was not successful. Please try again' although it is successful. How do i know this?? I placed the 'Login Name' control over the top of my page where its displaying the username with which i logged in.

i.e it displays the error msg and my user name ( which means my login was successful right?)

4) Apart from this when i logout and try to login again with the same username it displays the same error msg BUT this time it really does not login in. That username & password does not work anymore and i have to create a new one and its a cycle again from Step2.

Where am i going wrong?

How to use ValidationGroup to verify the successful login



How to check the validation if the user is logged?



Directory listing without showing file extension?



I've seen various tutorials and scripts online which show how to create a directory tree which list the file name, size etc.

My question is, I need a script that is basically a normal directory listing but it doesn't show the file extension.  If anyone can even point me in the right direction it'd be of much help!



Your login attempt was not successful. Please try again.

I keep getting the same message "Your login attempt was not successful. Please try again." after I tried to login many times. The database named ASPNETDB was successfully created in the App_Data folder of the application. Still, I get the same error message. Do you have any idea why I keep getting on it?

how to login in my portal using the user's username and password in active directory


i have a username and password in my portal... i want to connect to the active directory to verify the username and password of the user?

using c# .net

anyone can help me?

Login in a modal - success redirects to modal :(


I have the login view showing up in a modal dialog (using jquery simplemodal), and when the user fails login - it works fine - the error goes back to the modal.  The problem is when the user successfully logs in - the page is supposed to be redirected and the modal disappears, but the modal is now updated with the entire page :( 

In order for the modal to look correct - i check to see in the AccountController if the source of the login was Ajax, if so - return a partial view (to display in the modal) if not, return the full view (in case a user tries to access a page from outside of the website)

public ActionResult LogOn()
            if (Request.IsAjaxRequest())
                return PartialView("_LogOn");

            return View();

        public ActionResult LogOn(LogOnModel model, string returnUrl)
            if (ModelState.IsValid)
                if (MembershipService.ValidateUser(model.UserName, model.Password))
                    FormsService.SignIn(model.UserName, model.RememberMe);
                    if (!String.IsNullOrEmpty(returnUrl))
                        return Redirect(returnUrl);

get user name after successful login...


I created a website using asp.net 2008 and have the following code:

<asp:loginview id="LoginArea" runat="server">
 <asp:login id="Login1" runat="server">
   <div class="login">
    <h4>Login to Site</h4>
    <asp:label runat="server" id="UserNameLabel" CssClass="label" associatedcontrolid="UserName">User Name</asp:label>
    <asp:textbox runat="server" id="UserName" cssclass="textbox" accesskey="u" />
    <asp:requiredfieldvalidator runat="server" id="UserNameRequired" controltovalidate="UserName"
          validationgroup="Login1" errormessage="User Name is required." tooltip="User Name 
          is required." >*</asp:requiredfieldvalidator>
    <asp:label runat="server" id="PasswordLabel" CssClass="label" associatedcontrolid="Password">Password</asp:label>
    <asp:textbox runat="server" id="Password" textmode="Password" cssclass="textbox" accesskey="p" />

sometime redirects to login page


HI all,

        In my webapplication I am using a WebUserConrol as page header where I am showing login user's information and a logout button.

        I placed this WebuserControl every form. But sometimes when I click a buton Or selects a item from DropDownlists. it auto redirects to my default page index.asp which is my login page. But somtimes it works fine. How it can be possible.

here is my WebUserControls's code

aspx goes here

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="WebUserControl.ascx.cs" Inherits="WebUserControl" %>

<link href="css/mystyle.css" rel="stylesheet" type="text/css" />
<div style="text-align: center">
    <table border="0" cellpadding="0" cellspacing="0" width="800" align="center">
            <td  align="left" class="content">
            <td style="width: 100px">
            <td style="width: 111px">
            <td  align="right" style="width: 7px">
            <td  align="left" class="content">

Login authentication using Active Directory for ASP.NET applications

This article explains how to authenticate the users while login into asp.net application against active directory in a simple way.
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend