pass comtrol name to a subroutine

  • Thread starter Thread starter GH
  • Start date Start date
G

GH

How is it possible to pass a control name (possibly one of several) to
a subroutine in VB.Net (for aspx page)

I have multiple gridviews on a page and one of them will be exported
to Excel, however which one depends on other factors. I have an
export routine that works but I don't want to duplicate it for each
gridview. If I know which one gets exported I would like to call the
sub like ExportGV(GVName)

Thanks.
 
How is it possible to pass a control name (possibly one of several) to
a subroutine in VB.Net (for aspx page)

I have multiple gridviews on a page and one of them will be exported
to Excel, however which one depends on other factors. I have an
export routine that works but I don't want to duplicate it for each
gridview. If I know which one gets exported I would like to call the
sub like ExportGV(GVName)

Thanks.

Use the control's ID property (it's a string).

For instance:

ExportGV(grdSomeDataToExport.ID)

Hope this helps.

Mike
 
Back
Top