473,626 Members | 3,427 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

how to access a group of controls?

Hi,
I created a group of user controls in an aspx form.
which is as follow:

<body>
<form id="Form1" method="post" runat="server">
<SUBWAY:PEOPLEI NFO id="Peopleinfo0 " runat="server" Caption="Depend ent
Information"></SUBWAY:PEOPLEIN FO>
<p></p>
<SUBWAY:PEOPLEI NFO id="Peopleinfo1 " runat="server" Caption="Depend ent
Information"></SUBWAY:PEOPLEIN FO>
<p></p>
<SUBWAY:PEOPLEI NFO id="Peopleinfo2 " runat="server" Caption="Depend ent
Information"></SUBWAY:PEOPLEIN FO>
<p></p>
<SUBWAY:PEOPLEI NFO id="Peopleinfo3 " runat="server" Caption="Depend ent
Information"></SUBWAY:PEOPLEIN FO>
<p></p>
<SUBWAY:PEOPLEI NFO id="Peopleinfo4 " runat="server" Caption="Depend ent
Information"></SUBWAY:PEOPLEIN FO>
<p></p>
<SUBWAY:PEOPLEI NFO id="Peopleinfo5 " runat="server" Caption="Depend ent
Information"></SUBWAY:PEOPLEIN FO>
<p><asp:label id="Label1" style="Z-INDEX: 150; LEFT: 80px; POSITION:
absolute; TOP: 450px" runat="server"> label</asp:label><asp: button
id="Submit1" style="Z-INDEX: 102; LEFT: 72px; POSITION: absolute; TOP: 420px"
onclick="button _click"
runat="server" Text="Submit"></asp:button></p>
</form>
</body>
But I don't know how to write efficient codes to collect data from this
group of user controls, maybe I created in a very silly way, can you give me
a hint?
Thanks.
--
Betty
Jan 12 '06 #1
2 1679
Consider every control to be able to process the user input and commands by
either 1) handling its own events, or 2) raising an event per request for
action to be handled by the container class (the page).
--
HTH,
Phillip Williams
http://www.societopia.net
http://www.webswapp.com
"c676228" wrote:
Hi,
I created a group of user controls in an aspx form.
which is as follow:

<body>
<form id="Form1" method="post" runat="server">
<SUBWAY:PEOPLEI NFO id="Peopleinfo0 " runat="server" Caption="Depend ent
Information"></SUBWAY:PEOPLEIN FO>
<p></p>
<SUBWAY:PEOPLEI NFO id="Peopleinfo1 " runat="server" Caption="Depend ent
Information"></SUBWAY:PEOPLEIN FO>
<p></p>
<SUBWAY:PEOPLEI NFO id="Peopleinfo2 " runat="server" Caption="Depend ent
Information"></SUBWAY:PEOPLEIN FO>
<p></p>
<SUBWAY:PEOPLEI NFO id="Peopleinfo3 " runat="server" Caption="Depend ent
Information"></SUBWAY:PEOPLEIN FO>
<p></p>
<SUBWAY:PEOPLEI NFO id="Peopleinfo4 " runat="server" Caption="Depend ent
Information"></SUBWAY:PEOPLEIN FO>
<p></p>
<SUBWAY:PEOPLEI NFO id="Peopleinfo5 " runat="server" Caption="Depend ent
Information"></SUBWAY:PEOPLEIN FO>
<p><asp:label id="Label1" style="Z-INDEX: 150; LEFT: 80px; POSITION:
absolute; TOP: 450px" runat="server"> label</asp:label><asp: button
id="Submit1" style="Z-INDEX: 102; LEFT: 72px; POSITION: absolute; TOP: 420px"
onclick="button _click"
runat="server" Text="Submit"></asp:button></p>
</form>
</body>
But I don't know how to write efficient codes to collect data from this
group of user controls, maybe I created in a very silly way, can you give me
a hint?
Thanks.
--
Betty

Jan 12 '06 #2
Hi Betty,

As for accessing the Usercontrol's states in page code, you can consider
the suggestion I also posted in your another thread in this groups:

Subject: how to access user control in aspx file
Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet

We can programmaticall y access them like:
(check the control's type to see whether they're of the expected
usercontrol's type):
=============== ======
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load

Dim form1 As HtmlForm = Page.FindContro l("form1")
Dim ctrl As Control

For Each ctrl In form1.Controls
Response.Write( "<br>" & ctrl.GetType(). ToString())
Next
End Sub
=============== =======

Thanks,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

--------------------
| Thread-Topic: how to access a group of controls?
| thread-index: AcYXF25iFyBvK4Y yTVeTI9DD4bvaqw ==
| X-WBNR-Posting-Host: 64.253.156.46
| From: "=?Utf-8?B?UGhpbGxpcCB XaWxsaWFtcw==?= "
<Ph************ **@webswapp.com >
| References: <98************ *************** *******@microso ft.com>
| Subject: RE: how to access a group of controls?
| Date: Wed, 11 Jan 2006 17:28:03 -0800
| Lines: 48
| Message-ID: <E8************ *************** *******@microso ft.com>
| MIME-Version: 1.0
| Content-Type: text/plain;
| charset="Utf-8"
| Content-Transfer-Encoding: 7bit
| X-Newsreader: Microsoft CDO for Windows 2000
| Content-Class: urn:content-classes:message
| Importance: normal
| Priority: normal
| X-MimeOLE: Produced By Microsoft MimeOLE V6.00.3790.0
| Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet
| NNTP-Posting-Host: TK2MSFTNGXA03.p hx.gbl 10.40.2.250
| Path: TK2MSFTNGXA02.p hx.gbl!TK2MSFTN GXA03.phx.gbl
| Xref: TK2MSFTNGXA02.p hx.gbl
microsoft.publi c.dotnet.framew ork.aspnet:3702 30
| X-Tomcat-NG: microsoft.publi c.dotnet.framew ork.aspnet
|
| Consider every control to be able to process the user input and commands
by
| either 1) handling its own events, or 2) raising an event per request for
| action to be handled by the container class (the page).
| --
| HTH,
| Phillip Williams
| http://www.societopia.net
| http://www.webswapp.com
|
|
| "c676228" wrote:
|
| > Hi,
| > I created a group of user controls in an aspx form.
| > which is as follow:
| >
| > <body>
| > <form id="Form1" method="post" runat="server">
| > <SUBWAY:PEOPLEI NFO id="Peopleinfo0 " runat="server"
Caption="Depend ent
| > Information"></SUBWAY:PEOPLEIN FO>
| > <p></p>
| > <SUBWAY:PEOPLEI NFO id="Peopleinfo1 " runat="server"
Caption="Depend ent
| > Information"></SUBWAY:PEOPLEIN FO>
| > <p></p>
| > <SUBWAY:PEOPLEI NFO id="Peopleinfo2 " runat="server"
Caption="Depend ent
| > Information"></SUBWAY:PEOPLEIN FO>
| > <p></p>
| > <SUBWAY:PEOPLEI NFO id="Peopleinfo3 " runat="server"
Caption="Depend ent
| > Information"></SUBWAY:PEOPLEIN FO>
| > <p></p>
| > <SUBWAY:PEOPLEI NFO id="Peopleinfo4 " runat="server"
Caption="Depend ent
| > Information"></SUBWAY:PEOPLEIN FO>
| > <p></p>
| > <SUBWAY:PEOPLEI NFO id="Peopleinfo5 " runat="server"
Caption="Depend ent
| > Information"></SUBWAY:PEOPLEIN FO>
| > <p><asp:label id="Label1" style="Z-INDEX: 150; LEFT: 80px; POSITION:
| > absolute; TOP: 450px" runat="server"> label</asp:label><asp: button
| > id="Submit1" style="Z-INDEX: 102; LEFT: 72px; POSITION: absolute; TOP:
420px"
| > onclick="button _click"
| > runat="server" Text="Submit"></asp:button></p>
| > </form>
| > </body>
| > But I don't know how to write efficient codes to collect data from this
| > group of user controls, maybe I created in a very silly way, can you
give me
| > a hint?
| > Thanks.
| > --
| > Betty
|

Jan 12 '06 #3

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

Similar topics

6
4738
by: Peter Frost | last post by:
Please help I don't know if this is possible but what I would really like to do is to use On Error Goto to capture the code that is being executed when an error occurs. Any help would be much appreciated. Thanks in advance
5
2455
by: CSDunn | last post by:
Hello, I have ‘Snap to Grid' turned off when I am working in the Design View of either a form or report. However, it only seems to be off when I use the mouse. If I try to move controls with CTRL/Arrow keys, the controls snap to the grid again. This makes lining up controls very difficult. What can I do so that the controls don't snap to the grid when I use the keyboard to move them?
8
3508
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At the moment the printed output is usually going to Word. It's turning into an unholy mess, because I'm having to prepare umpteen different Word templates, and the queries that drive them, depending on what events a course has.
6
2791
by: MS | last post by:
Access 97 here. I want a simple way to "lock" certain records on a form. Some records remain "live" until all data is available which happens over time. When all the fields are complete, I want the record to be able to be "locked", or intentionally unlocked. I thought of having a check box called "chkedit" that can be clicked when the data entry for the record is complete. I have the following code in the OnCurrent event for the...
42
11515
by: lauren quantrell | last post by:
So many postings on not to use the treeview control, but nothing recently. Is it safe to swim there yet with Access 2000-Access 2003?
16
7211
by: TD | last post by:
This is the code under a command button - Dim ctl As Control For Each ctl In Me.Controls If ctl.BackColor <> RGB(255, 255, 255) Then ctl.BackColor = RGB(255, 255, 255) End If Next ctl
64
4566
by: John | last post by:
Hello there, Im cursing my place of employment...and its taken me a month to realise it... The scenario: Ive just stepped into a role to migrate an access database to VB.Net. The access database runs on terminal services and supports approximatly 25-30 users. It is crapping out big time, corrupted data, changes to the front end are difficult for someone unfamiliar with the system (me), the table structure is bad...really bad....there is...
0
7658
MMcCarthy
by: MMcCarthy | last post by:
Rather than using the Access design view change the view to SQL. I am going to attempt to outline the general syntax used for SQL queries in Access. Angle brackets <> are used in place of some syntax elements you must supply. The description of these elements will be in the contained in the angle brackets. Square brackets are used to show which parts are optional. Basic SELECT query SELECT <field list> FROM <table/query name(s)>
9
4485
by: prakashwadhwani | last post by:
Hi !! I'm about to develop a new project for a client. Should I go about it in Access 2003 or 2007 ? Purchasing it either for me or for my client is not a major consideration here ... what I'd like to know is the stability, speed & ease of use of both the products. I believe Access 2007 has a new file format too and that it may be slower.
0
8713
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8644
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8370
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8514
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7206
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6126
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5579
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
1
1817
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1516
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.