473,405 Members | 2,354 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,405 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 1314
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: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.