Wrox Programmer Forums
|
ASP.NET 1.0 and 1.1 Basics ASP.NET discussion for users new to coding in ASP.NET 1.0 or 1.1. NOT for the older "classic" ASP 3 or the newer ASP.NET 2.0.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 1.0 and 1.1 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 29th, 2003, 02:59 PM
UrI UrI is offline
Registered User
 
Join Date: Jul 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to UrI
Default ASP.NET problem

Hi,
My problem is that when I want to view the aspx file in browser I get the error: Could not load type:[Namespace].[Class]
In code behind(of ascx), I declared namespace and class.Then I made <%@Register TagPrefix="FileManager" TagName="Header" Src=Header.ascx"%> in aspx/html.
I can see the namespace and class in object browser.

What should I do?

 
Old July 29th, 2003, 08:00 PM
Authorized User
 
Join Date: Jun 2003
Posts: 97
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to planeswalk
Default

Hi,

Please show us the exact error message that you get as well as your code, if possible.

Cheers!
Marlon
 
Old July 31st, 2003, 05:35 PM
Authorized User
 
Join Date: Jul 2003
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

I have received a similar error myself. Are you using VS.Net to build your page? If so you will need to 'build' the solution (or project) first before it will run correctly.

 
Old August 1st, 2003, 01:55 PM
UrI UrI is offline
Registered User
 
Join Date: Jul 2003
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to UrI
Default

Yes I'm using VS.NET. I build the solution, but error is still appearing.
This is the sample in Wrox book, but I get the error.
Here's my code snippet:

--(aspx file)--
<%@ Register
    TagPrefix="FileManager" TagName="Footer"
    Src="Footer.ascx"
%>
<%@ Register
    TagPrefix="FileManager" TagName="Header"
    Src="Header.ascx"
%>
<%@ Page
    Language="vb"
    Inherits="Wrox.WebModules.FileManager.Web.BrowseFi les"
    Codebehind="BrowseFiles.aspx.vb"
    AutoEventWireup="false"
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
    <HEAD>
        <title>File Manager: Browse </title>
        <meta content="Microsoft Visual Studio.NET 7.0" name="GENERATOR">
        <meta content="Visual Basic 7.0" name="CODE_LANGUAGE">
        <meta content="JavaScript" name="vs_defaultClientScript">
        <meta content="http://schemas.microsoft.com/intellisense/ie5" name="vs_targetSchema">
        <LINK href="/ThePhile/Styles/ThePhile.css" type="text/css" rel="stylesheet">
        <script language="javascript">
      function CreateDir()
      {
        dirName=prompt('Type the name of the directory you want to create:', '');

        if ((dirName) && (dirName!=""))
        {
          document.forms['BrowseFiles'].elements['functParam'].value=dirName ;
          __doPostBack('CreateDir', '');
        }
       }
     function CreateFile()
       {
         filename=prompt('Type the name of the file you want to create:', '');

         if ((filename) && (filname!="")
           {
            document.forms['BrowseFiles'].elements['funcParam'].value=filename;
            __doPostBack('CreateFile','');
           }
        }
     function Rename(path)
       {
         newName=prompt('Type the new name for this File/Folder:','');
           if ((newName) && (newName!=""))
             {
               document.forms['BrowseFiles'].elements['funcParam'].value=path;
               document.forms['BrowseFiles'].elements['funcExtraParam'].value=newName;
               __doPostBack('Rename', '');
             }
        }
        </script>
    </HEAD>
    <body MS_POSITIONING="GridLayout">
        <form id="Browse Files" method="post" encType="multipart/form-data" runat="server">
            <FILEMANAGER:HEADER id="Title" runat="server"></FILEMANAGER:HEADER><br>
            <input id="funcParam" type="hidden" runat="server"> <input id="funcExtraParam" type="hidden" runat="server">
            <table class="MenuTable" width="100%" border="0">
                <tr>
                    <td><A href="javascript:CreateDir();"><IMG height="28" alt="Create a new directory" src="./Images/NewFolder.gif" width="28" border="0">
                        </A>
                        <asp:linkbutton id="CreateDir" onclick="CreateDir_Click" Runat="server"></asp:linkbutton><A href="javascript:CreateFile();"><IMG height="28" alt="Create a new text file" src="./Images/NewFile.gif" width="28" border="0">
                        </A>
                        <asp:linkbutton id="CreateFile" onclick="CreateFile_Click" Runat="server" Visible="False"></asp:linkbutton></A><asp:linkbutton id="Rename" onclick="Rename_Click" Runat="server" Visible="False"></asp:linkbutton></td>
                </tr>
            </table>
            <br>
            <asp:table id="Table1" Runat="server" CssClass="Grid_Header_Thin" Width="100%">
                <asp:TableRow>
                    <asp:TableCell Width="36%">
                        <asp:Image Runat="server" Height="32" Width="32" ImageUrl="./Images/OpenFolder.gif" />
                    </asp:TableCell>
                    <asp:TableCell>
                        <asp:Label Runat="server" ID="FolderDescription" />
                    </asp:TableCell>
                </asp:TableRow>
            </asp:table><asp:table id="FoldersAndFiles" Runat="server" CssClass="Grid_General" Width="100%">
                <asp:TableRow CssClass="Grid_Header">
                    <asp:TableCell width="36px" />
                    <asp:TableCell text="Index" />
                    <asp:TableCell Width="25px" />
                    <asp:TableCell Width="45px" />
                    <asp:TableCell Text="Attribs" Width="50px" />
                    <asp:TableCell Text="Size" Width="80px" HorizontalAlign="Right" />
                    <asp:TableCell text="Created" Width="140px" />
                    <asp:TableCell Text="Last modified" Width="140px" />
                </asp:TableRow>
            </asp:table><br>
            <asp:table id="Table2" runat="server">
                <asp:TableRow>
                    <asp:TableCell Width="80px" Font-Bold="True" Text="Upload file:" />
                    <asp:TableCell>
                        <input type="file" id="UploadFile" runat="server" size="35">
                    </asp:TableCell>
                    <asp:TableCell>
                        <asp:Button ID="Upload" Runat="server" Text="Upload" CssClass="Button" OnClick="Upload_Click" />
                    </asp:TableCell>
                </asp:TableRow>
            </asp:table><asp:label id="StatusMessage" Runat="server" Visible="False" CssClass="StatusMessage" Width="100%"></asp:label><asp:label id="FolderStyle" Runat="server" Visible="false" text="Grid_Item"></asp:label><asp:label id="FileStyle" Runat="server" Visible="False" text="Grid_AlternatingItem"></asp:label></form>
        <FileManager:Footer id="Footer" runat="server" />
    </body>
</HTML>

--(code behind)--
Imports System
Imports System.Collections
Imports System.ComponentModel
Imports System.Data
Imports System.Drawing
Imports System.Web
Imports System.Web.SessionState
Imports System.Web.UI
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls
Imports System.IO
Imports Wrox.WebModules.FileManager.Web.Controls.User


Namespace WebModules.FileManager.Web

   + Public Class BrowseFiles...
end namespace

--(ascx file)--
<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="Footer.ascx.vb"
Inherits="Wrox.WebModules.FileManager.Web.Controls .User.Footer"
%>
<div align="right" width="100%">
    <a href="#top"><img src="./images/GoUp.gif" alt="Go to the top of the page" border="0">
    </a>
</div>
<a name="bottom">

--(code behind)--
Imports System
Imports System.Data
Imports System.Drawing
Imports System.Web
Imports System.Web.UI.WebControls
Imports System.Web.UI.HtmlControls

Namespace WebModules.FileManager.Web.Controls.User
    Public MustInherit Class Footer
        Inherits System.Web.UI.UserControl

#Region " Web Form Designer Generated Code "

        'This call is required by the Web Form Designer.
        <System.Diagnostics.DebuggerStepThrough()> Private Sub InitializeComponent()

        End Sub

        Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init
            'CODEGEN: This method call is required by the Web Form Designer
            'Do not modify it using the code editor.
            InitializeComponent()
        End Sub

#End Region

        Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
            'Put user code to initialize the page here
        End Sub

    End Class
End Namespace


Error=
Parser Error Message: Could not load type 'Wrox.WebModules.FileManager.Web.Controls.User.Foo ter'.

Source Error:


Line 1: <%@ Control Language="vb" AutoEventWireup="false"
Line 2: Codebehind="Footer.ascx.vb"
Line 3: Inherits="Wrox.WebModules.FileManager.Web.Controls .User.Footer"


Source File: c:\inetpub\wwwroot\ThePhile\Modules\FileManager\Fo oter.ascx Line: 1

 
Old August 1st, 2003, 03:01 PM
Authorized User
 
Join Date: Jul 2003
Posts: 28
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Have you registered the Namespace 'WebModules.FileManager.Web.Controls.User' as a reference in your solution?







Similar Threads
Thread Thread Starter Forum Replies Last Post
Custom HTTP 404 Problem w/ASP to ASP.NET kwilliams ASP.NET 2.0 Professional 7 November 26th, 2007 04:17 PM
Problem Converting C# to VB.NET in ASP.NET kwilliams ASP.NET 2.0 Basics 0 February 9th, 2007 06:22 PM
asp.net problem [email protected] Visual Studio 2005 1 January 22nd, 2007 10:49 AM
Problem with Exercise in Beg. asp.net for VB.net! mrfella71 BOOK: Beginning ASP.NET 1.0 1 October 23rd, 2005 12:06 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.