CS0030 error
-
I have faced with an strange problem. I created a web site with ASP.NET 2. In various pages, I put Login Control as well as PasswordRecovery Control and CreateNewUser control. Everything is OK when you are running the app. But when you publish it into your site, you will got the CS0030 error when visiting the Login and Password Recovery pages. I don't know why. It is strange because the ASP.NET Development Server shows the pages perfectly without any problem. Best regards, A. Riazi
-
I have faced with an strange problem. I created a web site with ASP.NET 2. In various pages, I put Login Control as well as PasswordRecovery Control and CreateNewUser control. Everything is OK when you are running the app. But when you publish it into your site, you will got the CS0030 error when visiting the Login and Password Recovery pages. I don't know why. It is strange because the ASP.NET Development Server shows the pages perfectly without any problem. Best regards, A. Riazi
-
The error is as below: 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: CS0030: Cannot convert type 'ASP.login_aspx' to 'System.Web.UI.WebControls.Login' Source Error:
Line 120: public login_aspx() {
Line 121: string[] dependencies;
Line 122: ((Login)(this)).AppRelativeVirtualPath = "~/Login.aspx";
Line 123: if ((global::ASP.login_aspx.@__initialized == false)) {
Line 124: global::ASP.login_aspx.@__stringResource = this.ReadStringResource();Source File: c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\mygrouptour\f1c3628f\5bb6eba8\App_Web_login.aspx.cdcab7d2.lfujdkcs.0.cs Line: 122 Best regards, A. Riazi
-
The error is as below: 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: CS0030: Cannot convert type 'ASP.login_aspx' to 'System.Web.UI.WebControls.Login' Source Error:
Line 120: public login_aspx() {
Line 121: string[] dependencies;
Line 122: ((Login)(this)).AppRelativeVirtualPath = "~/Login.aspx";
Line 123: if ((global::ASP.login_aspx.@__initialized == false)) {
Line 124: global::ASP.login_aspx.@__stringResource = this.ReadStringResource();Source File: c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\mygrouptour\f1c3628f\5bb6eba8\App_Web_login.aspx.cdcab7d2.lfujdkcs.0.cs Line: 122 Best regards, A. Riazi
ok, so what does this mean? "But when you publish it into your site" Basically, the error is this. The login and the login page are different. The login is a WebControl and the Login is a WebForm. So thats why. It sounds as if though the code has confused the too. I dont have your complete code so I'm not really for sure. I would check to see if somehow you confused the 2 in code, a register tag, and something of that effect. Nick 1 line of code equals many bugs. So don't write any!!
-
ok, so what does this mean? "But when you publish it into your site" Basically, the error is this. The login and the login page are different. The login is a WebControl and the Login is a WebForm. So thats why. It sounds as if though the code has confused the too. I dont have your complete code so I'm not really for sure. I would check to see if somehow you confused the 2 in code, a register tag, and something of that effect. Nick 1 line of code equals many bugs. So don't write any!!
The code in previous thread is created by Visual Studio. Its not mine. When I used ASP.NET Development server there is no error. But when I publish the site on IIS, and when I navigate to log_in.aspx, I got the error. I sent you the code (to your hotmail email). Please take a look at it. Best regards, A. Riazi
-
The code in previous thread is created by Visual Studio. Its not mine. When I used ASP.NET Development server there is no error. But when I publish the site on IIS, and when I navigate to log_in.aspx, I got the error. I sent you the code (to your hotmail email). Please take a look at it. Best regards, A. Riazi
-
I have faced with an strange problem. I created a web site with ASP.NET 2. In various pages, I put Login Control as well as PasswordRecovery Control and CreateNewUser control. Everything is OK when you are running the app. But when you publish it into your site, you will got the CS0030 error when visiting the Login and Password Recovery pages. I don't know why. It is strange because the ASP.NET Development Server shows the pages perfectly without any problem. Best regards, A. Riazi
Hi there, From the error description in your post, I guess that before publishing the web site, the web page login.aspx uses the code behind file that contains the partial class named
Login
. If this is the case, then the problem is the name of the partial classLogin
. As you may already know that at runtime the ASP.NET generates a dynamic class reprenting the web page, if the web page either uses the code behind file or thePage
directive does not specify theInherits
attribute, then by default the dynamic class should contains something like:...((System.Web.UI.Page)(this)).AppRelativeVirtualPath = "~/Login.aspx";...
The
System.Web.UI.Page
is specified in the casting operation, not the base class of the Login web page. If thePage
directive specifies the base class in theInherits
attribute and theCodeFile
attribute is not used. Then theSystem.Web.UI.Page
is replaced with the base class name:((Login)(this)).AppRelativeVirtualPath = "~/Login.aspx";
Unfortunately, the
Login
name is the same as theLogin
control defined in theSystem.Web.UI.WebControls
namespace, so as a result it causes the compilation error of the invalid casting operation. If you have a look at thePage
directive of the web page Login.aspx after publishing the web site, you will see that only theInherits
attribute is specified. So to fix the error, you simply replace the nameLogin
of the partial class with another one, say_Login
, and also update theInherits
attribute.