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 SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Custom Web Control ?

Status
Not open for further replies.

hanglam

Programmer
Dec 11, 2002
143
0
0
US
Hi, I created a Custom Web Control.

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

<%@ register TagPrefix=&quot;SARSTag&quot; NameSpace=&quot;SARSControls&quot; Assembly=&quot;DataTextbox&quot; %>

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

<SARSTag:DataTextbox runat=&quot;server&quot; id=&quot;DataTextbox1&quot; />

I get an error message on the Designer Screen saying:
&quot;Error Creating Control&quot;

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

&quot;Value can not be null. Parameter name:eek: &quot;

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
 
<%@ register TagPrefix=&quot;SARSTag&quot; NameSpace=&quot;SARSControls&quot; Assembly=&quot;SARSControls&quot; %>

try this
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top