473,327 Members | 1,919 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

Custom Web Control ?

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:o "

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
Jul 21 '05 #1
1 1312
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

On Thu, 6 Nov 2003 00:39:57 -0500, "HANG LAM" <ha*****@hotmail.com>
wrote:
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:o "

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


Jul 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: Christian H | last post by:
Hi! I've created a custom control (myDrawControl) that deals with drawing. This control is then added to a form( myMainForm) Now, whenever something is dragged and dropped onto myDrawControl ,...
15
by: Tinus | last post by:
Hello all, I've created a custom control that draws a monthly schedule (using the Draw function in C#). Basically it draws 31 boxes and writes the day number in every box. This works...
21
by: One Handed Man \( OHM - Terry Burns \) | last post by:
When using a custom control. In order to check and see if values have changed one has to implement the IPostBackDataCollection interface. The values returned for the control seem to be simply a...
1
by: Wannabe_Geek | last post by:
Hi Iam new to MS .Net technology just getting along with it....I created a custom control ,which takes in a query and displays the data in a tabular format....something similar to a datagrid. ...
7
by: Shimon Sim | last post by:
I have a custom composite control I have following property
2
by: Suzanne | last post by:
Hi all, I'm reposting this message as I'm experiencing this problem more and more frequently : I really hope someone out there can help me as I've been tearing my hair out on this one for a...
4
by: Smokey Grindle | last post by:
What is the best way to write dynamic controls in ASP.NET 2.0?
11
by: Pete Kane | last post by:
Hi All, does anyone know how to add TabPages of ones own classes at design time ? ideally when adding a new TabControl it would contain tab pages of my own classes, I know you can achieve this with...
15
by: rizwanahmed24 | last post by:
Hello i have made a custom control. i have placed a panel on it. I want this panel to behave just like the normal panel. The problem i was having is that the panel on my custom control doesnt...
5
by: gerry | last post by:
I am trying to create a custom container control that will only ever contain a specific type of control. At design time, when a control of a different type is added to the container I would like...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.