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

Assigning vallues to fields in user control - help me please?

I made a user control to gather usa address information and would like
to know why the following doesn't work (I am assigning the valid of
textbox in a second instance of the control from the first instance of
the control) The textboxes hold date values.

If Len(USAAddress1.ValidFromCur) > 0 Then
USAAddress2.ValidFromCur = USAAddress1.ValidFromCur
End If

Here is the Property method in the user control's class file:

Public Property ValidFromCur()
Get
Return Me.txtValidFromCur
End Get
Set(ByVal Value)
Me.txtValidFromCur.Text = Value
End Set
End Property

Public Property ValidToCur()
Get
Return Me.txtValidToCur
End Get
Set(ByVal Value)
Me.txtValidToCur.Text = Value
End Set
End Property

For the other child controls there is no problem with this. I can
assign things such as Street Address 1, City, etc.

The only way this works is if I append ".text", such as
If Len(USAAddress1.ValidFromCur.Text) > 0 Then
USAAddress2.ValidFromCur.Text = USAAddress1.ValidFromCur.Text
End If
This *bugs* me because I considered I've already done this in the above
property method...Can someone help? What is the *proper* way to do
this?

Thank you. (very much)

Nov 19 '05 #1
3 1227
Turn option strict on.

The ValidFromCur getter returns the actual textbox, and the setter expects a
string...option strict would have pointed that out to you.

seems like it should be

return Me.txtValidFromCur.Text

Karl

--
MY ASP.Net tutorials
http://www.openmymind.net/ - New and Improved (yes, the popup is annoying)
http://www.openmymind.net/faq.aspx - unofficial newsgroup FAQ (more to
come!)
<JJ****@hotmail.com> wrote in message
news:11**********************@g49g2000cwa.googlegr oups.com...
I made a user control to gather usa address information and would like
to know why the following doesn't work (I am assigning the valid of
textbox in a second instance of the control from the first instance of
the control) The textboxes hold date values.

If Len(USAAddress1.ValidFromCur) > 0 Then
USAAddress2.ValidFromCur = USAAddress1.ValidFromCur
End If

Here is the Property method in the user control's class file:

Public Property ValidFromCur()
Get
Return Me.txtValidFromCur
End Get
Set(ByVal Value)
Me.txtValidFromCur.Text = Value
End Set
End Property

Public Property ValidToCur()
Get
Return Me.txtValidToCur
End Get
Set(ByVal Value)
Me.txtValidToCur.Text = Value
End Set
End Property

For the other child controls there is no problem with this. I can
assign things such as Street Address 1, City, etc.

The only way this works is if I append ".text", such as
If Len(USAAddress1.ValidFromCur.Text) > 0 Then
USAAddress2.ValidFromCur.Text = USAAddress1.ValidFromCur.Text
End If
This *bugs* me because I considered I've already done this in the above
property method...Can someone help? What is the *proper* way to do
this?

Thank you. (very much)

Nov 19 '05 #2
Thank you - will try all.

Nov 19 '05 #3
You are right, I didn't return the text property in the property
method...
Thank you again...

Nov 19 '05 #4

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

Similar topics

2
by: B Love | last post by:
Hello Group, I have 2 text fields that I would like to concatenate for use in a table. One field is an ordinary text box. The other is a simple combo box which I use to select one of about ten...
3
by: Lynn | last post by:
Hello, I have some user controls on a page...one for the user to fill in name, address, etc., and the other for the user to fill in credit card information. I have built the user controls in...
3
by: Geoff C Melbourne | last post by:
I'm new to asp.net. I have an ASP.Net form that contains literally 50 fields for the user to enter for a contacts details. All these fields are stored in the one table. So I have a class that...
18
by: TORQUE | last post by:
Hi, Im wondering if anyone can help me with a problem. I have a form with more than 50 unbound fields. Some of the fields will be blank from time to time. This seems to be where im having...
14
by: meisterbartsch | last post by:
Hi, I want to assign predefined vallues to a vector, like: std::vector<doubletr; tr={3.36,2.09,1.47,1.1,0.87,0.72}; how do i do this? Am I able to assign values without using .push_back();...
3
by: guido | last post by:
I've written a user control to add form fields to a aspx page: Private Sub buildFields() 'Label1.Text = "building fields at " & System.DateTime.Now() Dim themeIDField As New TextBox()...
3
jullianps
by: jullianps | last post by:
HI everyone, here is my question and I hope it isn't or it hasn't been posted before, probably it has but I spent a few minutes looking through the forums and with the search feature and nothing...
9
by: markla | last post by:
Hi, I have an EDM model, which I'm rendering using DynamicData pages. I need to add a derived/calculated field. For example, in a "Person" entity, I have LastName and FirstName. I need to...
4
by: pankajsingh5k | last post by:
Hi guys, These question is for all the experts... Please help me before my brain explodes The problem is again with the formview control.. I have a formview and i have to use it that...
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
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
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
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
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...
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.