Jump to content
Xtreme .Net Talk

Recommended Posts

Posted

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

Posted

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...

Posted

In your user control, have a property or a function like below

 

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

 

In your main page reference your control

 

response.write(myControl.GetCount())

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...