Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx thread: Custom ASP+ Controls


Message #1 by "Sagi Sefer" <sagis@s...> on Mon, 25 Sep 2000 14:49:45 +0100
Hi

I try to build asp+ controller and in the browser in get error message

****

Compiler Error Message: BC30560: The name 'myControl' is ambiguous in the

namespace 'WebApplication1'.

****



the control code is :



Imports System

Imports System.web

Imports System.Web.UI



Namespace WebApplication1



    Public Class myControl

        Inherits Control

        Overrides Sub Render(ByVal writer As HtmlTextWriter)

            writer.Write("This is my controler")

        End Sub

    End Class

End Namespace



and the .aspx file is :



<%@ Page Language="vb" Codebehind="test1.vb"      

                                    Inherits="WebApplication1.WebForm1"%>

<%@ Register TagPrefix="sagi" Namespace="WebApplication1" %>

<HTML><HEAD>

    <meta name="GENERATOR" content="Microsoft Visual Studio 7.0">

    <meta name="CODE_LANGUAGE" content="Visual Basic 7.0">

 </HEAD>

  <BODY>

      this is test page number 1

      <sagi:myControl runat="server" />

  </BODY></HTML>



Thanks a lot

sagis@y...

Message #2 by =?iso-8859-1?Q?Fredrik_Norm=E9n?= <fredrik.normen@e...> on Mon, 25 Sep 2000 16:25:38 +0200
Hi,



Try to remove this from the @ Page

> Codebehind="test1.vb" Inherits="WebApplication1.WebForm1"



I think the problem is that you have the class "myControl" in the "Code

behind" file test1.vb.



/Fredrik Normen





-----Original Message-----

From: Sagi Sefer [mailto:sagis@s...]

Sent: den 25 september 2000 15:50

To: ASP+

Subject: [aspx] Custom ASP+ Controls





Hi

I try to build asp+ controller and in the browser in get error message

****

Compiler Error Message: BC30560: The name 'myControl' is ambiguous in the

namespace 'WebApplication1'.

****



the control code is :



Imports System

Imports System.web

Imports System.Web.UI



Namespace WebApplication1



    Public Class myControl

        Inherits Control

        Overrides Sub Render(ByVal writer As HtmlTextWriter)

            writer.Write("This is my controler")

        End Sub

    End Class

End Namespace



and the .aspx file is :



<%@ Page Language="vb" Codebehind="test1.vb"

                                    Inherits="WebApplication1.WebForm1"%>

<%@ Register TagPrefix="sagi" Namespace="WebApplication1" %>

<HTML><HEAD>

    <meta name="GENERATOR" content="Microsoft Visual Studio 7.0">

    <meta name="CODE_LANGUAGE" content="Visual Basic 7.0">

 </HEAD>

  <BODY>

      this is test page number 1

      <sagi:myControl runat="server" />



---

</BODY></HTML>



Thanks a lot

sagis@y...




  Return to Index