Re: populate public property from a function

Tech-Archive recommends: Repair Windows Errors & Optimize Windows Performance



That depends on what you are trying to do in the first place. You either
want the user to assign a value to the property or you don't and want to
assign the variable a value returned by a function instead.

"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot com> wrote in message
news:%23jldn$HSGHA.224@xxxxxxxxxxxxxxxxxxxxxxx
"myfunction" is in the control.

Yes, I am totally confused on this and really need help.

what should I be doing ?





"Marina Levit [MVP]" <someone@xxxxxxxxxx> wrote in message
news:%236og2UHSGHA.4440@xxxxxxxxxxxxxxxxxxxxxxx
Where is 'myfunction' declared? This looks like a scoping issue.

I am also confused why in the Set for a property, you would completely
ignore the argument and just call a function. Why bother having a Set on
the property to begin with? People are going to be setting the property
to something - but that something will be complete ignored? Very
confusing.

"Jon Paal" <Jon[ nospam ]Paal @ everywhere dot com> wrote in message
news:evc1ARHSGHA.5908@xxxxxxxxxxxxxxxxxxxxxxx
I have a public property in my server control and I want to populate it
with values generated by the control.

When I assign the value of the property to a function in the control,
which creates the values, I get a compilation error that says the
function doesn't have all the other property values to work with.

So, how do I populate the arraylist as a public property, so I can use
it in my web page ?


========== code in use ==========
I create the property wth the webpage by:

...............
Dim arrTempList As New ArrayList()
oThis.myArrayList = arrTempList
..............


I have the the property defined in the control as:

....................
Public arrChartList As Arraylist
Public Property myArrayList As ArrayList
Get
Return arrChartList
End Get
Set
arrChartList = myfunction() '<--builds values for
arraylist
End Set
End Property
......................









.



Relevant Pages

  • Re: populate public property from a function
    ... This looks like a scoping issue. ... Very confusing. ... When I assign the value of the property to a function in the control, ... So, how do I populate the arraylist as a public property, so I can use it ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Custom Web Control not showing up in Toolbox
    ... This is my first time trying to creaet and use a custome Web Control in a Web Site project in ASP.NET 2.0 with VS 2005 and VB. ... Public Property ExportType() As AppType ... Dim FileExtension As String = ".xls" ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Custom Web Control not showing up in Toolbox
    ... control in a separate Web Control Library project. ... Public Property ExportType() As AppType ... Dim FileExtension As String = ".xls" ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Custom Web Control not showing up in Toolbox
    ... control in a separate Web Control Library project. ... Public Property ExportType() As AppType ... Dim FileExtension As String = ".xls" ...
    (microsoft.public.dotnet.framework.aspnet)
  • Re: Custom Web Control not showing up in Toolbox
    ... I got around that by right-clicking in the toolbox and selected "Add a Tab". ... reference the control in any other way at all. ... Public Property ExportType() As AppType ...
    (microsoft.public.dotnet.framework.aspnet)