Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Problems in asp.net website after publishing

Problems in asp.net website after publishing

Scheduled Pinned Locked Moved ASP.NET
csharphelpasp-netdatabasevisual-studio
4 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    Arun kumar Gautam
    wrote on last edited by
    #1

    I created asp.net website who is holding a login page, Here is the code behind of my login page using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; using System.Data.SqlClient; using System.Web.UI; using System.Web.UI.WebControls; using System.Configuration; using DbProjectLibrary; public partial class Login : System.Web.UI.Page { string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString.ToString(); DBClass db = new DBClass(); protected void Page_Load(object sender, EventArgs e) { } protected void loginbtn_Click(object sender, EventArgs e) { string type="Admin"; string get_login = "select * from login where Type='" + type + "'"; DataTable dt = db.get_data(get_login, type, constr); //gview.DataSource = dt; //gview.DataBind(); string user = usertxt.Text; string pass = Passwrdtxt.Text; string username = dt.Rows[0][1].ToString(); string password = dt.Rows[0][2].ToString(); if (username == user.ToLower() && password == pass) { Session["login"] = username; Response.Redirect("~/Profiles/Default.aspx?type=Admin"); } else { errlbl.Text = "You are not authorized to login"; } } } when i run this code using vs 2012 than it runs perfectly but when i publish it online and try to run it through iis than it shows that error Server Error in '/' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0246: The type or namespace name 'DBClass' could not be found (are you missing a using directive or an assembly reference?) Source Error: Line 9: public partial class Login : System.Web.UI.Page Line 10: { Line 11: DBClass db = new DBClass(); Line 12: protected void Page_Load(object sender, EventArgs e) Line 13: { can anyone help me with it

    B 1 Reply Last reply
    0
    • A Arun kumar Gautam

      I created asp.net website who is holding a login page, Here is the code behind of my login page using System; using System.Collections.Generic; using System.Linq; using System.Web; using System.Data; using System.Data.SqlClient; using System.Web.UI; using System.Web.UI.WebControls; using System.Configuration; using DbProjectLibrary; public partial class Login : System.Web.UI.Page { string constr = ConfigurationManager.ConnectionStrings["constr"].ConnectionString.ToString(); DBClass db = new DBClass(); protected void Page_Load(object sender, EventArgs e) { } protected void loginbtn_Click(object sender, EventArgs e) { string type="Admin"; string get_login = "select * from login where Type='" + type + "'"; DataTable dt = db.get_data(get_login, type, constr); //gview.DataSource = dt; //gview.DataBind(); string user = usertxt.Text; string pass = Passwrdtxt.Text; string username = dt.Rows[0][1].ToString(); string password = dt.Rows[0][2].ToString(); if (username == user.ToLower() && password == pass) { Session["login"] = username; Response.Redirect("~/Profiles/Default.aspx?type=Admin"); } else { errlbl.Text = "You are not authorized to login"; } } } when i run this code using vs 2012 than it runs perfectly but when i publish it online and try to run it through iis than it shows that error Server Error in '/' Application. Compilation Error Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. Compiler Error Message: CS0246: The type or namespace name 'DBClass' could not be found (are you missing a using directive or an assembly reference?) Source Error: Line 9: public partial class Login : System.Web.UI.Page Line 10: { Line 11: DBClass db = new DBClass(); Line 12: protected void Page_Load(object sender, EventArgs e) Line 13: { can anyone help me with it

      B Offline
      B Offline
      Blikkies
      wrote on last edited by
      #2

      Make sure your application pool is set to the correct framework in your IIS Manager e.g. if your website is build with framework 4, make sure you application pool is set to .Net Framework Version v4.0. And if your website is build with framework 3.5, make sure you application pool is set to .Net Framework Version v2.0.

      A 1 Reply Last reply
      0
      • B Blikkies

        Make sure your application pool is set to the correct framework in your IIS Manager e.g. if your website is build with framework 4, make sure you application pool is set to .Net Framework Version v4.0. And if your website is build with framework 3.5, make sure you application pool is set to .Net Framework Version v2.0.

        A Offline
        A Offline
        Arun kumar Gautam
        wrote on last edited by
        #3

        I made the modification but it still doesn't working still

        F 1 Reply Last reply
        0
        • A Arun kumar Gautam

          I made the modification but it still doesn't working still

          F Offline
          F Offline
          Forbiddenx
          wrote on last edited by
          #4

          If you use deploy, then you have to be aware that it does not always deploy everything. You may need to look into a library that exist on your local dev but not on your deployed iis, Check the dlls, and controls etc.. Make sure that they are all either in your app bin dir or registered on your deployment box.

          =)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups