Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Professional
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
ASP.NET 2.0 Professional If you are an experienced ASP.NET programmer, this is the forum for your 2.0 questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Professional section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developersí questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
 
 
Thread Tools Display Modes
  #1 (permalink)  
Old June 24th, 2006, 04:14 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default Could not load type 'WebForm1' error

Hello all
i have problem with my inherit class when i upload my .net page to the web.my page name is webform1.aspx and in its html at line 1 i have such code:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb" Inherits="WebForm1"%>
that defines the inheritance of webform1 class for this page. but when i upload it it gives me the error:Could not load type 'webform1' error .I changed the tag inherits to:inherits="netfiles.webform1"
in which netfiles is the name of folder that webform1.aspx is in it.
Is there any one here can help me please???????
I would be very happy if some one helps me
thank you


  #2 (permalink)  
Old June 24th, 2006, 04:54 AM
Authorized User
 
Join Date: Jun 2006
Location: Manchester, , United Kingdom.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi There,

I don't know whether this seems like an obvious question to you or not (sorry if it is!), but have you also uploaded the compiled dll (from the bin directory) to the web server? The type (webform1) that it is trying to find should be built into this.

Hope this helps,
Rich

  #3 (permalink)  
Old June 24th, 2006, 07:42 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

hi
thank you for your reply
yes,i've uploaded bin (dll)but it doesn't work.should i change anything else?????
thank you again

  #4 (permalink)  
Old June 24th, 2006, 02:05 PM
Authorized User
 
Join Date: Jun 2006
Location: Manchester, , United Kingdom.
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Hi Again,

Another problem could be that the permissions are set incorrectly on the /bin directory of your deployed web application. This would prevent asp.net from finding the dll within the bin directory.

I am assuming that you application's file structure is something like the following:

projectname/webform1.aspx
projectname/bin
projectname/bin/projectname.dll

Is this correct in your situation?

Also, try to delete the bin directory locally and rebuild the project to ensure a clean dll in the bin folder.

Rich

  #5 (permalink)  
Old June 25th, 2006, 01:15 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

hi
I deleted the project file completely in my ftp and the upload it again.but it gives me that error agai:(and as you know i cant change the folder properties in ftp because server doesn't let me to do it.I'm really confused:(what should I do?:(help me please again
thank you

  #6 (permalink)  
Old July 4th, 2006, 08:30 AM
Registered User
 
Join Date: Oct 2003
Location: , , .
Posts: 3
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Not sure if this would apply (I think you would need to be using VS.net), but make sure your vbproj file contains a reference to the webform1 file. If it does not, it's quite probable that the code-behind is not being compiled into the .dll.

You can view the contents of the proj file with any text viewer.
  #7 (permalink)  
Old July 5th, 2006, 12:08 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

my vbproj file has a refrence to webform1 but it doesn't work yet.
please help me to fix it.
thank you

  #8 (permalink)  
Old July 5th, 2006, 07:51 AM
Authorized User
Points: 375, Level: 6
Points: 375, Level: 6 Points: 375, Level: 6 Points: 375, Level: 6
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Apr 2006
Location: New Delhi,India.
Posts: 79
Thanks: 1
Thanked 0 Times in 0 Posts
Send a message via AIM to anujrathi Send a message via MSN to anujrathi Send a message via Yahoo to anujrathi Send a message via Skype™ to anujrathi
Default

Hi,

whenever u want to use any form in other forms, pls make the object first and then use it.

Pls send ur code, so that we can find the error correctly.

Regards,
Anuj Rathi
  #9 (permalink)  
Old July 5th, 2006, 08:48 AM
Friend of Wrox
 
Join Date: May 2005
Location: tehran, tehran, Iran.
Posts: 201
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via Yahoo to hastikeyvan
Default

I don't get how can i make the object?
here is my code and sorry if it is very huge
Imports System.Data
Imports System.Data.SqlClient
Imports System.Web.Mail
Imports System.Web.Util

Public Class WebForm2
    Inherits System.Web.UI.Page
    Dim con As SqlConnection
    Dim ds, ds1, ds2, ds3, ds4, ds5, ds6, ds7, ds8, ds9 As DataSet
    Dim strSql, strSql1, strSql2, strSql3, strSql4, strSql5, strSql6, strSql7, strSql8, strSql9, strcon As String
    Dim da, da1, da2, da3, da4, da5, da6, da7, da8, da9 As SqlDataAdapter
    Dim d As Integer
#Region " Web Form Designer Generated Code "

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

    End Sub
    Protected WithEvents Label2 As System.Web.UI.WebControls.Label
    Protected WithEvents Label3 As System.Web.UI.WebControls.Label
    Protected WithEvents Label8 As System.Web.UI.WebControls.Label
    Protected WithEvents Label1 As System.Web.UI.WebControls.Label
    Protected WithEvents DataGrid1 As System.Web.UI.WebControls.DataGrid
    Protected WithEvents Label4 As System.Web.UI.WebControls.Label
    Protected WithEvents DataGrid2 As System.Web.UI.WebControls.DataGrid
    Protected WithEvents Label5 As System.Web.UI.WebControls.Label
    Protected WithEvents DataGrid3 As System.Web.UI.WebControls.DataGrid
    Protected WithEvents Label6 As System.Web.UI.WebControls.Label
    Protected WithEvents DataGrid4 As System.Web.UI.WebControls.DataGrid
    Protected WithEvents Label7 As System.Web.UI.WebControls.Label
    Protected WithEvents DataGrid5 As System.Web.UI.WebControls.DataGrid

    'NOTE: The following placeholder declaration is required by the Web Form Designer.
    'Do not delete or move it.
    Private designerPlaceholderDeclaration As System.Object

    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

    Sub DataGrid1sub()
        strcon = "Data Source=aaaa;Initial Catalog=bbb;User Id=bbb;Password=ggg;"
        con = New SqlConnection(strcon)
        con.Open()

        da = New SqlDataAdapter("select * from tbHGInf where Row is not null and Row<>' ' and DateDiff(d,ModifyDate,GetDate())<=7 and DateDiff(d,ModifyDate,GetDate())>=0 order by HGNo Asc", con)
        ds = New DataSet

        da.Fill(ds, "tbHGInf")

        If (ds.Tables(0).Rows.Count > 0) Then

            DataGrid1.DataSource = ds.Tables("tbHGInf").DefaultView
            DataGrid1.DataBind()
        Else
            DataGrid1.Visible = False
            Label1.Visible = False

        End If
        con.Close()

    End Sub
and 4 more subGrids
    Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        If Not IsPostBack Then
            Call DataGrid1sub()
            Call datagrid2sub()
            Call DataGrid3Sub()
            Call DataGrid4Sub()
            Call DataGird5Sub()
        End If
    End Sub
thank you

  #10 (permalink)  
Old July 11th, 2008, 08:26 AM
Registered User
 
Join Date: Jul 2008
Location: , , .
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Check that the dll version and the pdb version should be same.

 


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error could not load type - RoleManager mussitsch ASP.NET 2.0 Professional 0 August 21st, 2007 12:31 PM
Parser Error Message: Could not load type '_Defaul sahmed1983 VB Databases Basics 1 January 25th, 2007 09:12 AM
Could not load type 'WebForm1' error hastikeyvan ASP.NET 2.0 Basics 0 June 22nd, 2006 02:31 AM
type load exception crazy_eye_bob Crystal Reports 4 November 7th, 2005 01:16 PM



All times are GMT -4. The time now is 12:27 AM.


Powered by vBulletin®
Copyright ©2000 - 2017, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.