Custom Web Control ?

H

HANG LAM

Hi, I created a Custom Web Control.

My problem is , when I registed the control using the following line :

<%@ register TagPrefix="SARSTag" NameSpace="SARSControls"
Assembly="DataTextbox" %>

and then add the control to the page using this line :

<SARSTag:DataTextbox runat="server" id="DataTextbox1" />

I get an error message on the Designer Screen saying:
"Error Creating Control"

and when I click on the control , it gives me this dialog pop-up saying :

"Value can not be null. Parameter name:blush: "

Anybody seen this kind of error before ?
Any help is appreciated ..

Thanks,
hang


Here is my source code for the Custom Control (pretty simple ):


Imports System.ComponentModel
Imports System.Web.UI

Namespace SARSControls
Public Class DataTextbox
Inherits System.Web.UI.WebControls.TextBox
Implements INamingContainer


Private _testID As Integer
Private _resultID As Integer
Private _specimenID As String
Private _labID As Integer

Public Sub New()
MyBase.New()
End Sub

Public Property TestID()
Get
Return _testID
End Get
Set(ByVal Value)
_testID = Value
End Set
End Property

Public Property ResultID()
Get
Return _resultID
End Get
Set(ByVal Value)
_resultID = Value
End Set
End Property

Public Property LabID()
Get
Return _labID
End Get
Set(ByVal Value)
_labID = Value
End Set
End Property

Public Property SpecimenID()
Get
Return _specimenID
End Get
Set(ByVal Value)
_specimenID = Value
End Set
End Property

End Class

End Namespace
 
J

Jim

Hang,

My guess would be that the problem lies in the definition of your
contorl... I am a little new to .NET, but I am assuming the SARSTag
and SARSControls library are things you authored... C++, C#, or XML or
something, so that would probably be the place to look. It sounds
like the design environment is complaining about the initialization of
the ctonrol, and error that is coming back from the control's
underlying code, not your implementation of it... or at least that's
my guess. My apologies if I'm completely off base... Jus thtought I'd
give it a shot, as I know what it's like to be up at 2am trying to
figure something out.

But hey, if you don't get anywhere on this one, then have a look over
my posts and maybe you can get me up and going.... :)

JIM
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top