Jump to content


Check out our Community Blogs

Register and join over 40,000 other developers!


Recent Status Updates

View All Updates

Photo
- - - - -

Login error

asp.net login

  • Please log in to reply
3 replies to this topic

#1 malcolm.clancy

malcolm.clancy

    CC Lurker

  • Just Joined
  • Pip
  • 2 posts

Posted 06 October 2008 - 05:19 AM

Hey I was searching for the following error and found that several of user of this forum had extensive knowledge in this area.

The error occuring when i'm trying to build my website are:

Error 1 'ASP.login_aspx.GetTypeHashCode()': no suitable method found to override c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\sanctuary\674b719e\e178197c\App_Web_b7ibtk1d.0.cs 700

Error 2 'ASP.login_aspx.ProcessRequest(System.Web.HttpContext)': no suitable method found to override c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\sanctuary\674b719e\e178197c\App_Web_b7ibtk1d.0.cs 705

and

Error 3 'ASP.login_aspx' does not implement interface member 'System.Web.IHttpHandler.IsReusable' c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\sanctuary\674b719e\e178197c\App_Web_b7ibtk1d.0.cs 184

if anyone can give me any suggestions of where to look to fix this problem that would be great.

also any source code you need to look at to further assist me feel free to ask for.

Cheers Malcolm
  • 0

#2 amrosama

amrosama

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 2765 posts

Posted 06 October 2008 - 05:31 AM

You are making an instant forum, right?
If the answer is yes,plz post the code of the login part and declaration
  • 0

#3 amrosama

amrosama

    CC Mentor

  • VIP Member
  • PipPipPipPipPipPipPipPip
  • 2765 posts

Posted 06 October 2008 - 05:49 AM

I had that error before you have to make this change to the code that declares the user identity to the following code:
instantASP.Instantforum.Components.User  xxx = new instantASP.Instantforum.Business.User.Selectuser(system.Web.Httpcontext.Current.User.Identity);
note: xxx means your variable name replace it with yours
  • 0

#4 malcolm.clancy

malcolm.clancy

    CC Lurker

  • Just Joined
  • Pip
  • 2 posts

Posted 06 October 2008 - 06:34 PM

I'm not actually using InstantASP. I'm just trying to create a logon which connects to a database I created to go along with the site(e-commerce web site). I used this code before for another site which I implemented in VS2005, this one I'm doing in 2008 and as far as I know that is the only differance between the two implementations. Here is the code I'm using in the code behind file. Again if you need to view any of my other code just ask.

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.OleDb;
using System.Security.Cryptography;
using System.Text;
using System.Collections.Specialized;

public partial class login : System.Web.UI.Page
{

    protected void Page_Load(object sender, EventArgs e)
    {
        string loginDetails = (string)Session["UserName"];

        if (loginDetails != null)
        {
            UserInfolbl.Text = "You are currently logged in with the UserName: " + loginDetails + ". If you wish to log out, click the logout button";
            UserName.Visible = false;
            UserNameLbl.Visible = false;
            PassWord.Visible = false;
            PassWordLbl.Visible = false;

            LoginBtn.Text = "Logout";
        }


        if (IsPostBack)
        {
            if (loginDetails != null)
            {
                Session.Abandon();

                Response.Redirect("default.aspx");
            }
            else if (UserName.Text == "")
            {
                loginStatuslbl.Visible = true;
                loginStatuslbl.Text = "Please enter a valid UserName address";
            }
            else if (PassWord.Text == "")
            {
                loginStatuslbl.Visible = true;
                loginStatuslbl.Text = "Please enter a valid Password";
            }
            else
            {

                try
                {

                    string ConnStr = ConfigurationManager.ConnectionStrings["SanctuaryDB"].ToString();
                    OleDbConnection loginData = new OleDbConnection(ConnStr);
                    loginData.Open();

                    string getPwordQuery = "SELECT [PatronID], [Password] FROM [Patrons] WHERE [UserName] = ?";

                    OleDbCommand getPwordQueryData = new OleDbCommand(getPwordQuery, loginData);
                    OleDbParameter eaddress = new OleDbParameter("@UserName", UserName.Text);
                    getPwordQueryData.Parameters.Add(uname);
                    OleDbDataReader retrievedData = getPwordQueryData.ExecuteReader();
                    retrievedData.Read();
                    int retrievedID = 0;
                    int.TryParse(retrievedData["PatronID"].ToString(), out retrievedID);
                    string retrievedPassword = retrievedData["Password"].ToString();
                    loginData.Close();

                    //string passwordMD5 = Md5AddSecret(PassWord.Text);
                    string passwordMD5 = PassWord.Text;

                    if (passwordMD5 == retrievedPassword)
                    {

                        Session.Add("UserName", UserName.Text);
                        Session.Add("PatronID", retrievedID);

                       

                        UserName.Visible = false;
                        UserNameLbl.Visible = false;
                        PassWord.Visible = false;
                        PassWordLbl.Visible = false;
                        LoginBtn.Visible = false;

                        UserInfolbl.Text = "Login was successful - Redirecting to new page...";

                        string redirectURL = (string)Session["redirectURL"];

                        if (redirectURL == null)
                        {
                            redirectURL = "default.aspx";
                        }

                        Response.Redirect(redirectURL);
                    }
                    else
                    {
                        loginStatuslbl.Visible = true;
                        loginStatuslbl.Text = "The Username/Password combination you entered was incorrect";
                    }
                }
                catch
                {
                    UserName.Visible = false;
                    UserNameLbl.Visible = false;
                    PassWord.Visible = false;
                    PassWordLbl.Visible = false;
                    LoginBtn.Visible = false;
                    UserInfolbl.Visible = false;

                    loginStatuslbl.Visible = true;
                    loginStatuslbl.Text = "<br />An error has occured while logging into your user account. Please contact BuyIt Administration if this problem persists.";
                }
            }
        }
    }
}

Edited by Jaan, 07 October 2008 - 06:03 AM.
Use code tags when you're posting your codes!

  • 0





Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download