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

Top 5 Contributors of the Month
Post New Web Links

Creating a login Help!

Posted By:      Posted Date: December 04, 2010    Points: 0   Category :ASP.Net

I am trying to add some custom error events to my login app. here is what i have currently... and I am referencing http://www.4guysfromrolla.com/articles/050306-1.aspx for the error code......

namespace Login
    public partial class Login : System.Web.UI.Page
        protected void Page_Load(object sender, EventArgs e)


        protected void Login1_Authenticate(object sender, AuthenticateEventArgs e)



I converted the VB to C# and here is the code that i need to put in to my login form, but i can not figure out where to put the code, because i keep getting errors.......

    protected void Login1_LoginError(object sender, System.EventArgs e) {
        // There was a problem logging in the user
        // See if this user exists in the database
        MembershipUser userInfo = Membership.GetUser(Login1.UserName);
        if ((userInfo == null)) {
            // The user entered an invalid username...
            LoginErrorDetails.Text = ("There is no user in the database with the username " + Login1.UserName);
        else {
            // See if the user is locked out or not approved
            if (!userInfo.IsApproved) {

View Complete Post

More Related Resource Links

Claims Walkthrough: Creating Trusted Login Providers (SAML Sign-in) for SharePoint 2010

Learn how to create a custom security token service (STS) and set up a trust relationship between a SharePoint 2010 farm and the custom STS

Creating Login Page Problem

I doing a login page using visual c# and encounter some problem on it. my database got Username, Password, and UserType I want to create a login page redirect the user to different page based on their roles. It show that there is an error on the code (line 24). Any idea on create a login page that redirect the user to different page based on their roles?It shows this message :   this type or namespace name 'DataView' could not be found(are you missing a using directive or an assembly reference)Here the code, protected void Page_Load(object sender, EventArgs e) { string connectionString = "Data Source =.\\SQLEXPRESS;" + "AttachDbFilename=\"C:\\Program Files\\Microsoft SQL Server\\MSSQL10.SQLEXPRESS\\MSSQL\\DATA\\UserDB.mdf\";" + "Integrated Security=True;" + "Connect Timeout=30;" + "User Instance=True;"; System.Data.SqlClient.SqlConnection conn = new System.Data.SqlClient.SqlConnection(connectionString ); System.Data.SqlClient.SqlCommand cmd = conn.CreateCommand(); conn.Open(); } protected void Button1_Click(object sender, EventArgs e) { SqlDataSource sds = new SqlDataSource(); sds.SelectParameters.Add("Username", TypeCode.String, this.TextBox1.Text); sds.

creating a login control


how to do i create a login control that isnt visible but appears when you press a button like if i have a button called login and i want that when you press that button the login control appears


Creating custom registration and login


I'm working on a project that requires registration and login.

I know that ASP.NET provides login controls to get that job easily done.

However, I'd like to implement custom registration and login.

I mean my own registration and login forms and my own database.

I've researched before posting this topic, but found nothing useful teaching me how to implement those functions.

Can you guys tell me the way to implement them using LINQ and VB?

OR can you give me the URL of the tutorial teaches exactly what I want?


Creating ASP.NET using NTLM gets login prompt


I have an ASP.NET that uses NTLM that is getting a login prompt. I am not sure why. This is a typical AD domain and I have created other web apps using NTLM which do not prompt for a username and password. Any ideas?

Creating Website for app causes login authenticaiton not to work


I have an ASP.NET application that uses the security created by an aspnetdb database.   The application works OK when it is running under the default web of IIS.   But I am working with my Network group and we are trying to create a simpler url for the application.  The network group asked that I create a Website for the application.  I did this in IIS 6.0 and I have the website point at the folder where the application resides.   But now the login dialog does not work right.  When I try to login using the new Website that application gives off an message that the password or login is incorrect.  This seems to be a configuration problem with the new website.  Perhaps that authentication database does not match the application name correctly.   How can I configure this new website so that the login dialog works OK.  It still works when I run the application from the old web located under the Default Web Site.  Any suggestions.

Thanks in advance,  Ed


Claims Walkthrough: Creating Claims Providers for Trusted Login Providers for SharePoint 2010

Learn how to create a claims provider for a trusted login provider, which is an external security token service (STS) that SharePoint trusts.

Creating your SharePoint Governance Plan

One of the most common questions that I get from prospects as I'm talking to them about the creation of a governance plan and process is what does it look like. In other words, there are materials available which describe what should be in a governance plan but there isn't a ton of guidance on what the process of creating a governance plan and process are.

Creating Paging for a Repeater Control

A common question is "How do I implement paging within a Repeater?" Although the beauty of the Repeater control is its flexibility, you're on your own for building most functions. ASP.NET 2.0 has included some new controls that provide paging, as does the DataGrid in ASP.NET 1.1. However, this tip shows you how to roll your own paging for a simple data viewer.

Creating an AJAX Repeater in ASP.NET MVC

The "TaskList" is a tried an true example of the most basic thing that you can do in any framework. Unfortunately, I had some problems finding a really good example of all the steps necessary to get a task list to work in ASP.NET MVC 1.0.

Creating a Generic Entity Framework 4.0 Repository

With .NET 4.0 right around the corner, I thought it would be cool to download Visual Studio 2010 beta 2 and start playing around with the next release of Entity Framework.

The initial release of Entity Framework came with a great deal of criticism. To make matters worse, there was a large uproar when it was rumored that Microsoft would be abandoning LINQ to SQL, in favor of Entity Framework. This was because, at the time, many developers felt Entity Framework was an inferior technology to LINQ to SQL. To set things right, Microsoft proactively moved forward with improving Entity Framework, in time for the 4.0 release of the .NET Framework. This is good news because my initial impressions, so far, have been nothing but positive.

Creating a Simple Class in C#

The second article in the C# Object-Oriented Programming tutorial describes how classes are created in C# and how behaviour, in the form of publicly visible and private, hidden methods can be added. This demonstrates some of the uses of encapsulation

Creating SharePoint items with CreateItemActivity

Instead of creating new list items from code in your workflow you can use CreateItemActivity. CreateItemActivity can be used for creating list items or files. Properties of interest for this activity are the following (most of them are self-explanatory):

Creating an Excel Spreadsheet programmatically using VB.NET

The Interoperability services make it very easy to work with COM Capable Applications such as Word and Excel. This article reveals using Excel from a managed application. Excel is the spreadsheet component of Microsoft Office 2000. The majority of Excel programmatic functionality is exposed through Automation via the type library Excel9.olb. The intention of this article is to express that a managed application can interrelate with Excel as a COM server.

Creating an Excel Spreadsheet and Adding Data to It Programmatically

The Interoperability services make it veryeasy to work with COM Capable Applications such as Word and Excel. Thisarticle reveals using Excel from a managed application. Excel is thespreadsheet component of Microsoft Office 2000. The majority of Excelprogrammatic functionality is exposed through Automation via the typelibrary Excel9.olb. The intention of this article is to express that amanaged application can interrelate with Excel as a COM server.

Creating Excel file from C#

I used below coding for create a excel sheet.I got from on web site.
In below coding there is no problem.Its create the excel file.If i run second time,its ask to overwrite the current excel file.If I said "Yes" then it ok ,but If I select cancel button,its generate the Error message.The exception is

Creating Sites/Lists/List Items under Current User Context in SharePoint By Using SPUserToken

Usually we do this by performing the action under RunWithElevatedPrivileges method and updating the listitem using SPListItem.SystemUpdate() method (see here). but this approach has its own flaws like (RunWithElevatedPrivileges will run under system account, we cannot use SystemUpdate for SPSite,SPWeb,SPList, since it runs under system we will "CreatedBy" by as SystemAccount).
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