Problems in asp.net website after publishing
-
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
-
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
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.
-
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.
I made the modification but it still doesn't working still
-
I made the modification but it still doesn't working still
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.
=)