Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7159643
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T13:15:54+00:00 2026-05-28T13:15:54+00:00

I have created a website from File->new-> Web Site. i am trying to go

  • 0

I have created a website from File->new-> Web Site.
i am trying to go to mydomain.com/piro/admin/login.aspx
i have created a class named User.cs, this class is in the App_Code folder. when i run this web site locally, everything works fine, but when i move my files to the server i get the error on the User type. i tried to deploy my website, to copy my website, to create new on ftp website but nothing works, i have searched for a solution, but couldn’t find any answer for my problem. can any one please help..!
here is my code.

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data.SqlClient;
using System.Data;

public partial class admin_login : System.Web.UI.Page
{
 protected void Page_Load(object sender, EventArgs e)
{
    Label1.Text = "";
}
protected void Button1_Click(object sender, EventArgs e)
{
    User user = new User();
    user.username = txtUsername.Text;
    user.password = txtPassword.Text;

    User login = loggInn(user);
    if (login == null)
    {
        Label1.Text = "User name or password is wrong";
    }
    else
    {
        Session["userName"] = user.username;
        Session["lastvisit"] = login.lastvisit;
        Session["systemUser"] = login.role;
        // Session["rolle"] = godkjent.rolle;
        Response.Redirect("Default.aspx");
    }
    //string loggInn = checkUserLinq(user);

    // string check = checkUser(user);
}

public byte[] pass(string inn)
{
    var algoritme = System.Security.Cryptography.SHA1.Create();
    byte[] data, utdata;
    data = System.Text.Encoding.ASCII.GetBytes(inn);
    utdata = algoritme.ComputeHash(data);
    return utdata;
}
public User loggInn(User inn)
{
    using (var db = new DataClassesDataContext())
    {
        byte[] passordArray;
        passordArray = pass(inn.password);
        try
        {
            var brukere = from s in db.TUsers
                          where s.Username == inn.username &&
                           s.Password == passordArray
                          select new User
                          {
                              username = s.Username,
                              email = s.Email,
                              role = s.Role,
                              lastvisit = Convert.ToDateTime(s.Lastvisit)
                          };
            if (brukere.Count() == 0 || brukere == null)
            {
                return null;
            }

            User user = brukere.First();

            char[] x = inn.username.ToCharArray();
            int a = x.Length;
            char[] y = user.username.ToCharArray();
            for (int i = 0; i < x.Length; i++)
            {
                if (!y[i].Equals(x[i]))
                    return null;
            }
            return user;
        }
        catch (Exception err)
        {
            return null;
        }
    }
}
}

my web.config

<?xml version="1.0"?>
<configuration>
  <connectionStrings>
    <add name="testdbConnectionString" connectionString="Data     Source=tcp:myhost.com;Initial Catalog=testdb;User ID=testdb_user;Password=*****"
  providerName="System.Data.SqlClient" />
  </connectionStrings>
  <system.web>
    <compilation debug="false" targetFramework="4.0">
      <assemblies>
        <add assembly="System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
   </assemblies>
  </compilation>
  </system.web>
</configuration>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T13:15:55+00:00Added an answer on May 28, 2026 at 1:15 pm

    Now it is working fine. Here I write what I did in case someone faces the same problem.

    • Right click on solution and add new project-> classlibrary (name it whatevr you want).
    • Add the classes to the classlibrary.
    • Right click on the website and go to addreferences, select the classlibrary you just created.
    • Add using classlibrary on the top of the .cs files.
    • Build the solution.
    • Move/copy the bin folder to the root directory.

    I think it is very complicated when uploading the website to server; everything works fine locally. After much work locally things gets hard when uploading to server!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am using VS 2008. I have created a new Asp.net web site project
I have a list of items that are created from the results of website
I have created a facebook website open graph application for my website www.heyngine.com. The
I have created a Drupal website with a new page for registration purposes. I
I have a website created in .NET where users are required to register/login to
I need to move or copy a simple text file from one web site
I have a web site I created that uses Python, HTML, and javascript. The
I have created a asp.net Dynamic data linq to sql web site. After creating
I have two *.sql files that I use when creating a new web site
I am trying to fetch a JSON file from my website and parse it.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.