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. CS0030 error

CS0030 error

Scheduled Pinned Locked Moved ASP.NET
helpcsharpasp-netsysadmin
7 Posts 3 Posters 1 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
    Abbas_Riazi
    wrote on last edited by
    #1

    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 M 2 Replies Last reply
    0
    • A Abbas_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

      I Offline
      I Offline
      Ista
      wrote on last edited by
      #2

      Whats the text of the error? 1 line of code equals many bugs. So don't write any!!

      A 1 Reply Last reply
      0
      • I Ista

        Whats the text of the error? 1 line of code equals many bugs. So don't write any!!

        A Offline
        A Offline
        Abbas_Riazi
        wrote on last edited by
        #3

        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

        I 1 Reply Last reply
        0
        • A Abbas_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

          I Offline
          I Offline
          Ista
          wrote on last edited by
          #4

          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!!

          A 1 Reply Last reply
          0
          • I Ista

            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!!

            A Offline
            A Offline
            Abbas_Riazi
            wrote on last edited by
            #5

            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 1 Reply Last reply
            0
            • A Abbas_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 Offline
              I Offline
              Ista
              wrote on last edited by
              #6

              I can tonight when I get home. The machine at work is VS2003 Nick 1 line of code equals many bugs. So don't write any!!

              1 Reply Last reply
              0
              • A Abbas_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

                M Offline
                M Offline
                minhpc_bk
                wrote on last edited by
                #7

                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 class Login. 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 the Page directive does not specify the Inherits 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 the Page directive specifies the base class in the Inherits attribute and the CodeFile attribute is not used. Then the System.Web.UI.Page is replaced with the base class name:

                ((Login)(this)).AppRelativeVirtualPath = "~/Login.aspx";

                Unfortunately, the Login name is the same as the Login control defined in the System.Web.UI.WebControls namespace, so as a result it causes the compilation error of the invalid casting operation. If you have a look at the Page directive of the web page Login.aspx after publishing the web site, you will see that only the Inherits attribute is specified. So to fix the error, you simply replace the name Login of the partial class with another one, say _Login, and also update the Inherits attribute.

                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