CodeVerge.Net Beta
Login Idy
Register Password
  Forgot?
Explore    Item Entry    Members   
NEWSGROUP
.NET
Algorithms-Data Structures
Asp.Net
C Plus Plus
CSharp
Database
HTML
Javascript
Linq
Other
Regular Expressions
VB.Net
XML





Zone: > NEWSGROUP > Asp.Net Forum > windows_hosting.hosting_open_forum Tags:
Item Type: NewsGroup Date Entered: 1/18/2003 6:34:09 AM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
(NR, 0)
XPoints: N/A Replies: 10 Views: 24 Favorited: 0 Favorite
Can Reply:  No Members Can Edit: No Online: Yes
11 Items, 1 Pages 1 |< << Go >> >|
shamshularphin
Asp.Net User
Could not load control from assembly1/18/2003 6:34:09 AM

0/0

---------------------Edited by Colt -------------------------------
<code/> tag was added
---------------------Edited by Colt -------------------------------

Hi all
I need deparate help from you guys

I am developing custom control but prior to that i just tried sample control and tried to access it in asp.net page. Below i have given my code please let me know where i am going wrong.

---------VB Code ASSEMbLY NAME " TestControl "----------------

Imports System
Imports System.Web.UI
Imports System.Web.UI.WebControls

Namespace SIControls
Public Class FirstControl
Inherits Control

Private _text As String = "hello"

Public Overridable Property [Text]() As String
Get
Return _text
End Get

Set(ByVal Value As String)
_text = Value
End Set
End Property

Protected Overrides Sub Render(ByVal output As System.Web.UI.HtmlTextWriter)
output.Write([Text])
output.Write("<h1>This is first control</h1>")
End Sub
End Class
End Namespace



---------ASP.NET PAGE CODE ----------------

<%@ Register TagPrefix="SI" Namespace="SIControls" Assembly="TestControl"%>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<title>test</title>
<meta name="vs_defaultClientScript" content="JavaScript">
<meta name="vs_targetSchema" content="http://schemas.microsoft.com/intellisense/ie5">
<meta name="GENERATOR" content="Microsoft Visual Studio.NET 7.0">
<meta name="ProgId" content="VisualStudio.HTML">
<meta name="Originator" content="Microsoft Visual Studio.NET 7.0">
</HEAD>
<body MS_POSITIONING="GridLayout">
<SI:FirstControl runat="server" text="hello" id="FirstControl1" />
</body>
</HTML>

------END ASP.NET PAGE CODE---------

when i try to run this on browser it says that
"
Parser Error Message: Could not load type SIControls.FirstControl from assembly TestControl, Version=1.0.1112.27716, Culture=neutral, PublicKeyToken=null.

Source Error:


Line 11: </HEAD>
Line 12: <body MS_POSITIONING="GridLayout">
Line 13: <SI:FirstControl runat="server" text="hello" id="FirstControl1" />
Line 14: </body>
Line 15: </HTML>

"


PLEase help me out

regards
shamshularphin.
jwyckoff
Asp.Net User
Re: Could not load control from assembly1/19/2003 7:56:24 PM

0/0

Is your assembly containing the control in your web application's bin directory?

Jason
Jason Wyckoff

Kidan
Asp.Net User
Re: Could not load control from assembly3/11/2004 5:02:39 PM

0/0

I'm suffering from the same problem.

I'm building a custom control which compiles without errors. I've referenced the control in both the project (under the reference) and as an imports in the codebehind file.


Then when I try to use it I get this error. But I only get this error if I declare in the aspx page like this :


<%@ Register TagPrefix="spadb" namespace="SpaDB" Assembly="TechSoftControls" %>
<form id="Form1" method="post" runat="server">
Line 14: <spadb:SControl runat=server id=spMe controltype="TextBox" ></spadb:SControl>





If I declare it and add it programmatically it adds fine. Any ideas on why?



Thanks!
master4eva
Asp.Net User
Re: Could not load control from assembly3/14/2004 6:24:37 PM

0/0

Is the assembly file name "TechSoftControls.dll"? It should be... or you got the namespace incorrect there.
-- Justin Lovell
garymich
Asp.Net User
Re: Could not load control from assembly3/15/2004 1:15:28 AM

0/0

I too seem to be having an issue along the same lines. I copied the code from the article: The Power of Base Pages. As I am still using the Web Matrix tool only (though hope to go to VS .NET in the near future) it was a real treat having to figure out all the required Imports in order to get to a point where I could successfully build the .dll with just the SDK.

OK I finally accomplish this and try and run it just as a blank page, following some playing around with the directives when I finally tried: <%@ import Namespace="BasePagesVB" %>
I finally got it to render a blank page. Wow!

So I think great lets try the simple demo web form provided by the author in the article, and now all I get is a 404 Page Not Found Error. Wonderful! After all this scre..ng around I have really neat class that can display a blank page -- very impressive indeed.

Can some merciful soul please have pity on me and tell me whether or not I am supposed to be able to do this kind of stuff without using Visual Studio?

Thanks

Gary
fancyketsup
Asp.Net User
Re: Could not load control from assembly3/15/2004 2:21:02 PM

0/0

Sure you can... after you build your control just make a copy of the dll and put it into the app's bin folder that is gonna use it. Once you have a dll in the bin of your app you can access it. You will need to add code to the page that is going to use it telling it what the name space and assembly name is. In C# if I built a control in say a name space called MyNameSpace with a class name of StupidControl and then compiled it using a name like MyControl then in C# I would do this on the aspx page using it...


<%@ Register TagPrefix="MyPrefixCanBeWhatEver" Namespace="MyNameSpace" Assembly="MyControl" %>


then add it to the pge like this...


<MyPrefixCanBeWhatEver:StupidControl ID="StupidControl1" runat=server/>

Answering a question increases your knowledge asking a question shows your Intelligence!
Kidan
Asp.Net User
Re: Could not load control from assembly3/17/2004 7:44:37 PM

0/0

yes, the assembly is techsoftcontrols and the namespace is SpaDB.

What's odd, is that I transferred my code to C# and it worked the way it's supposed to. While the VB code still throws the same error.
garymich
Asp.Net User
Re: Could not load control from assembly3/18/2004 8:06:28 PM

0/0

Thanks, I can try that for some other stuff I have written which is in fact a control. In the situation I spoke off though I am extending the Page object. I re-wrote the entire thing in C# just to see if it would make any difference but it does not. The one thing that is consistent in both flavours is the compiler error that says Title does not exist in blah...

Currently in the pages declarations I have:

<%@ Page Language="C#" %>
<%@ Register TagPrefix="LW_Base" Namespace="BasePagesCS" Assembly="BasePagesCS" %>

The detailed compiler output is as follows:

C:\Inetpub\wwwroot\BasePagesWorkAreaCS\Default.aspx(11,9): error CS0103: The name 'Title' does not exist in the class or namespace 'ASP.Default_aspx'
C:\Inetpub\wwwroot\BasePagesWorkAreaCS\Default.aspx(15,9): error CS0246: The type or namespace name 'ContentArea' could not be found (are you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\BasePagesWorkAreaCS\Default.aspx(19,9): error CS0246: The type or namespace name 'NavigationBar' could not be found (are you missing a using directive or an assembly reference?)
C:\Inetpub\wwwroot\BasePagesWorkAreaCS\Default.aspx(26,9): error CS0246: The type or namespace name 'TitleBar' could not be found (are you missing a using directive or an assembly reference?)

Any ideas? Any help would be greatly appreciated.

Thanks

Gary




master4eva
Asp.Net User
Re: Could not load control from assembly3/19/2004 12:37:44 PM

0/0

Could you post the entire page up, by any chance?
-- Justin Lovell
garymich
Asp.Net User
Re: Could not load control from assembly3/19/2004 9:43:13 PM

0/0

Thanks for the quick response. Oddly enough about 5 minutes after I figure it out on my own the author of the article who by the way was great emailed me saying he didn't really know what else to suggest as he does not use Web Matrix.

For anyone else who had difficulties trying to build and use the Base Page class for VB I resolved the issue by putting this directive:

Page Language="VB" Inherits="BasePagesVB.BasePage"

Even tohoug my namespace is: BasePagesVB and the class name is: BasePage. Also I removed the: Handles MyBase.Load from the event handler declaration: Sub Page_Load(sender As Object, e As EventArgs).

Thanks to all for the help!

Gary
master4eva
Asp.Net User
Re: Could not load control from assembly3/20/2004 7:35:57 AM

0/0

BTW - if you are going to do base pages like so, then you can stop repetition by going under the web.config settings. So you will have a base page like so:

<configuration>
<system.web>
<pages pageBaseType="BasePagesVB.BasePage, BasePagesVB"/>
</system.web>
</configuration>

-- Justin Lovell
11 Items, 1 Pages 1 |< << Go >> >|



Search This Site:


Meet Our Sponsors:



Other Resources:

Could not load control from assembly - ng.asp-net-forum.windows ... Could not load control from assembly, > ROOT > NEWSGROUP > Asp.Net Forum > ... Re: Could not load control from assembly. 3/19/2004 9:43:13 PM. 0/0. Thanks for ...
Could not load file or assembly 'Microsoft.ReportViewer.WebForms ... Could not load file or assembly 'Microsoft.ReportViewer.WebForms, > ROOT > ... ReportViewer Control - Could not load file or assembly Microsoft.ReportViewer.WebForms ...
AJAX Control Toolkit - Could not load file or assembly vjslib | Blinded ... Error 1 Could not load file or assembly vjslib, Version=2.0.0.0, Culture=neutral, ... 0 Responses to "AJAX Control Toolkit - Could not load file or assembly vjslib" ...
Could not load file or assembly mom.implementation ... installed ATI Radeon rx1650 in xp home. software not accepted by Windows logo testing. downloaded drivers from Radeon ... menu of the Control Panel or > ...
Could not load file or assembly Microsoft.ReportViewer.WebForms ... Services ReportViewer Control - Could not load file or assembly Microsoft.ReportViewer.WebForms ... ReportViewer.WebForms assembly could not be loaded. ...
Steven Smith : Could not load file or assembly Microsoft.ReportViewer ... Writing a Days of the Week Selector Control .NET Data Access Performance Comparison ... Could not load file or assembly 'BasicFrame.WebControls.BasicDatePicker' ...
Could not load file or assembly App_Web... - ASP.NET Forums ... Configuration and Deployment " Could not load file or assembly App_Web... At times, one specific control's assembly might not be recreated, as its part of ...
Could not load file or assembly System.Data.Entity • Geekpedia ... ASP.NET DataGrid Control Newsgroup " Could Not Load File Or Assembly System.Data. ... Parser Error Message: Could not load file or assembly 'System.Data.Entity, ...


 
All Times Are GMT