A
Adam Smith
Firstly I appologise for the cross post, I've discovered more information
which pinpoints VS.NET 2003 as the problem.
The issue: I'm trying to create a server control, after failure I'm trying
some simplistic controls to build from
I'm using the following code:
SimpleControl.cs
------------------
using System;
using System.Web.UI;
namespace MSPress.ServerControls
{
public class SimpleControl : Control
{
protected override void Render(HtmlTextWriter writer)
{
writer.write("I don't do anything useful, ");
writer.write("but at least I'm a control...");
}
}
}
-----------------
SimpleControl.vb
-----------------
Imports System
Imports System.Web.UI
Namespace MSPress.ServerControls
Public Class SimpleControl : Inherits Control
Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
writer.write("I don't do anything usefula, ")
writer.write("but at least I'm a control...")
End Sub
End Class
End Namespace
-----------------
Webform1.aspx
-----------------
<%@ Register TagPrefix="msp" Namespace="MSPress.ServerControls"
Assembly="simplecontrol" %>
<%@ Page Language="VB" %>
<html>
<body>
<br>
Here is the output from our first custom control.
<br>
<MSP:SIMPLECONTROL id="simple1" runat="server" />
<br>
</body>
</html>
----------------
Webform1.aspx and Simplecontrol.cs are straight out of an MS book on server
controls and components.
I created the SimpleControl.vb based on the cs file.
I have compiled and run these as seperate non-vs.net web applications and
both work fine.
When I run them through vs.net, the c# version works fine but the vb version
creates an error:
ERROR:
------------
Description: An error occured during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.
Parser Error Message: Could not load type
MSPress.ServerControls.SimpleControl from assembly test2,
Version=1.0.1644.25788, Culture=neutral, PublicKeyToken=null
Source Error:
Line 9: <msp:SimpleControl id="simple1" runat="server" />
------------
Does anyone know why vs.net would run a c# server control correctly but not
a vb one, even when the code is workable.
Thanks in advance,
Adam Smith
which pinpoints VS.NET 2003 as the problem.
The issue: I'm trying to create a server control, after failure I'm trying
some simplistic controls to build from
I'm using the following code:
SimpleControl.cs
------------------
using System;
using System.Web.UI;
namespace MSPress.ServerControls
{
public class SimpleControl : Control
{
protected override void Render(HtmlTextWriter writer)
{
writer.write("I don't do anything useful, ");
writer.write("but at least I'm a control...");
}
}
}
-----------------
SimpleControl.vb
-----------------
Imports System
Imports System.Web.UI
Namespace MSPress.ServerControls
Public Class SimpleControl : Inherits Control
Protected Overrides Sub Render(ByVal writer As HtmlTextWriter)
writer.write("I don't do anything usefula, ")
writer.write("but at least I'm a control...")
End Sub
End Class
End Namespace
-----------------
Webform1.aspx
-----------------
<%@ Register TagPrefix="msp" Namespace="MSPress.ServerControls"
Assembly="simplecontrol" %>
<%@ Page Language="VB" %>
<html>
<body>
<br>
Here is the output from our first custom control.
<br>
<MSP:SIMPLECONTROL id="simple1" runat="server" />
<br>
</body>
</html>
----------------
Webform1.aspx and Simplecontrol.cs are straight out of an MS book on server
controls and components.
I created the SimpleControl.vb based on the cs file.
I have compiled and run these as seperate non-vs.net web applications and
both work fine.
When I run them through vs.net, the c# version works fine but the vb version
creates an error:
ERROR:
------------
Description: An error occured during the parsing of a resource required to
service this request. Please review the following specific parse error
details and modify your source file appropriately.
Parser Error Message: Could not load type
MSPress.ServerControls.SimpleControl from assembly test2,
Version=1.0.1644.25788, Culture=neutral, PublicKeyToken=null
Source Error:
Line 9: <msp:SimpleControl id="simple1" runat="server" />
------------
Does anyone know why vs.net would run a c# server control correctly but not
a vb one, even when the code is workable.
Thanks in advance,
Adam Smith