referencing objects in diff. user control

college_amy

Regular
Joined
Jan 3, 2004
Messages
83
I have a user control that has a datagrid on it. From that datagrid I want the count of the rows - which I have. No problem...
What I want to do is have that row count be displayed on the main page without having to set up a new stored procedure or datareader/grid on the main page. The datagrid is displayed on the main page (since it is a user control and all).

How do I pass the values from a user control back into the main page?????

Any help is appreciated.
Thanks,
Amy
 
I would, however, I already deleted it and am trying other guesses... so what I originally put in to get the error won't be the same...

I probably should mention... I am using a web tab from infragistics (headache alone) and the control is in the web tab and the tab is housed on the main page....
so referencing it is not fun...
 
In your user control, have a property or a function like below

Code:
    Public Function GetCount() As Integer
        'Bind datagrid
        Return myDatagrid.Items.Count
    End Function

In your main page reference your control

Code:
response.write(myControl.GetCount())
 
Back
Top