Wrox Programmer Forums
|
.NET Web Services Discussions about .NET XML Web Service technologies including ASMX files, WSDL and SOAP.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the .NET Web Services section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old July 30th, 2003, 07:27 AM
Registered User
 
Join Date: Jul 2003
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Properties

Regarding the Hashtable class, ht.Items.Add(x)

Public ReadOnly Property Items As ListItemCollection

What is the relationship between the above property and the public class ListItemCollection.
The below code is a simple class using a property to access another.
ca.Items.Add - Does this create a new instance of ClassB wihtin ClassA, I'm not sure
because with the HashTable class "Items" is a property and "Add" is a method of the type that Items refers to. The relation to HashTable is I have a dropdownlist control called c1. Now the statement c1.Items.Add(listItem) called X times. Wouldn't an instance of ListItemCollection be associated with dropdownlist c1.

Thanks.


<script runat="server">



  Public Class ClassB



    private count As Integer = 0



    Sub Add()

      count = count + 1

    End Sub



    Function getCount

      return count

    End Function



  End Class



  Public class ClassA



    Public ReadOnly Property Counter As ClassB

      Get

        return new ClassB

      End Get

    End Property



  End Class



  Sub Page_Load

    Dim ca As New ClassA

    ca.Counter.Add

    Response.Write(ca.Counter.getCount)

  End Sub



</script>





Similar Threads
Thread Thread Starter Forum Replies Last Post
oEvent has no properties bradrice BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 0 April 3rd, 2007 08:01 AM
Please help with query properties zachtom Access VBA 1 April 1st, 2004 12:22 PM
properties aadz5 C# 3 December 29th, 2003 11:38 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.