473,405 Members | 2,176 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,405 software developers and data experts.

pass comtrol name to a subroutine

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.

Mar 15 '07 #1
1 1080
On Mar 15, 1:52 pm, "GH" <dotnet...@hotmail.comwrote:
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

Mar 15 '07 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: Doug Jordan | last post by:
I am fairly new to Python. This should be an easy answer but I cannot get this to work. The code is listed below. I know how to do this in C, Fortran, and VB but it doesn't seem to work the same...
4
by: Sherman Willden | last post by:
I am trying to use Perl's XML::Twig to modify a version number in an XML document. At the very end of this posting is an excerpt from the xml document. Just before the xml excerpt is the Perl code...
3
by: JingleBEV | last post by:
Hi all, I am trying not to use global variable to maintain data consistency. Some procedures and functions will require to pass the recordset object for processing and functions may also return...
2
by: Richard | last post by:
Hi. How can I pass a subroutine as a parameter to another subroutine? How would the formal parameter list needs to be declared in order to receive a rubroutine (address)? Thanks in advance, ...
8
by: Patrick | last post by:
Hello - I'm working on a project to have 6 labels, each with a value of 0 - 9. Each label has a 2 buttons on the side, one labeled up, one labeled down. I want the up button to increment til it...
10
by: Robert Dailey | last post by:
Hi, I noticed in Python all function parameters seem to be passed by reference. This means that when I modify the value of a variable of a function, the value of the variable externally from the...
3
shrek123
by: shrek123 | last post by:
How can I pass output of some perl subroutine to a subroutine? I have Subroutine1 and wanna pass the return value of this subroutine as an argument to another subroutine. I tried this; ...
0
by: SenileOwl | last post by:
I'm working in Visual Basic .NET 2005 I'm creating a program that could potentially hold 50 or more subroutines. However, I will only be calling three or four of the subroutines at a time. I...
0
by: beebelbrox | last post by:
Greetings, I am stuck on this. Is it possible to have a subroutine in one database call a subroutine in a second database. my attempt below produces an error. The error i get is "compile error...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.