Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Creating an assembly custom control with a namespace in vb.net

Status
Not open for further replies.

glyns

Programmer
Dec 15, 2008
125
GB
I'm trying to create a compiled user control I can use
I've not got any useful code in at the moment it should just show "hello world"

This is hello.ascx page's code
Code:
<%@ Control Language="vb" AutoEventWireup="false" CodeBehind="hello.ascx.vb" Inherits="GControlNS.hello" ClassName="hello"%>
Hello world
this is the .vb code
Code:
Namespace GControlNS
  public Class hello
    Inherits System.Web.UI.UserControl
  End Class
End NameSpace

Which all compiles nicely but when I try to use it in my default.aspx page all I get is a blank page being loaded
Code:
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="Default.aspx.vb" Inherits="WebApplication1._Default" %>
<%@Register Assembly="GControl" Namespace="GControl.GControlNS" TagPrefix="GControl1" %>

<html xmlns="[URL unfurl="true"]http://www.w3.org/1999/xhtml"[/URL] >
<head runat="server">
</head>
<body>
<GControl1:hello runat="server" />
</body>
</html>
here's default.aspx.vb
Code:
Imports System.Windows.Forms
Imports GControl 
Partial Public Class _Default
    Inherits System.Web.UI.Page
  
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load

    End Sub
End Class

Can anyone tell me what stupid mistake I'm making this time or point me to some useful ultra-basic examples of how to do this that'ld be lovely
Thanks
 
For ASP.Net questions, you will want to ask them here: forum855 (not that your question won't get answered here eventually).

For VB.Net language specific questions, Windows Forms, Windows Services, Console Applications, Setup Projects, Class Library questions, then the VB.Net/VB2005 forum is the correct place for those.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top