473,388 Members | 1,377 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,388 software developers and data experts.

~ User Control Error - Referencing a text box ~

Hi,

I am trying to add a custom control into my own control called
'DateRange.ascx'.
Easier said than done. In the DateRange.ascx file it has two text
boxes called dfDateFrom and dfDateTo and also two properties which get
and set the textboxes data, see below :-

Public Property dtFrom() As String
Get
Return dfDateFrom.Text
End Get
Set(ByVal Value As String)
dfDateFrom.Text = Value
End Set
End Property

Public Property dtTo() As String
Get
Return dfDateTo.Text
End Get
Set(ByVal Value As String)
dfDateTo.Text = Value
End Set
End Property

So why is it that when from my 'TestDatesWithControl.aspx.vb'
(codebehind) file when I try and retrieve the data from one of the
fields in the control I get the following error :-

Object reference not set to an instance of an object

This is when I try and reference it in the following way (on click of
a button):-
Imports KREIOS_Site.CustomControls
Dim y As New UCDateRange
y.Start()
' IT GOES WRONG BELOW with the following error.
' Object reference not set to an instance of an object
lbTest2.Text = y.dtFrom

If you would like to see the actual source code please go to :-
http://www.levelup.co.uk/code/

Please Help.

Regards
Jay
Jul 21 '05 #1
0 1217

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

Similar topics

0
by: Secret Weasel | last post by:
Hi, I am trying to add a custom control into my own control called 'DateRange.ascx'. Easier said than done. In the DateRange.ascx file it has two text boxes called dfDateFrom and dfDateTo and...
4
by: patrick_a | last post by:
Hello, I am trying to insert multiple instances of a custom user control into a placeholder on an aspx page, based on the records retrieved from the database. I use the datareader to loop through...
6
by: martin | last post by:
Hi, I am a web page and a web user control. My web user control is placed in my web page using the following directive <%@ Register TagPrefix="uc1" TagName="Header"...
1
by: Jim Corey | last post by:
Hello, I have common dropdowns on several user controls, and so I'm trying to get of repetitive code. The dropdowns allow me to pick months, days, etc. I've put a dropdown on a usercontrol...
4
by: Josh Harris | last post by:
Here is my question: It is common to have many pieces of business logic encapsulated within asp.net user controls. This can be found in high visibility projects such as the iBuySpy portal from...
2
by: Joey | last post by:
Hi There, I am trying to get the selected value of a listbox when I click a button, everything works ok and I can bind the list and when I have a basic page and click a button to invoke a sub it...
6
by: Louise | last post by:
I use Visual Basic .NET Framework 1.1, Visual Studio. I have a Web page (aspx) referencing a control (ascx) that has a placeholder that is assigned one of 2 child controls through buttons. The...
5
by: Doug Handler | last post by:
Hi, I have a form (Form1) that contains a tab control which one tab has a customer user control (UserControl1). When the user double-clicks on the grid hosted there a new user control is...
8
by: fernandezr | last post by:
I would like to use a user control as a template inside a repeater. Some of the fields in the control should be hidden depending on whether or not there is data. I'm still a ASP .Net newbie so the...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.