Robert L. Stewart
rl_stewart at highstream.net
Mon Apr 24 12:16:27 CDT 2006
David, This is an Access group. You need to check on an ASP.Net group for answers to this. Try aspadvice.com and see if they can help you on that list. Robert L. Stewart The Dyson Group International Software for the Non-profit Enterprise Expanding your Sphere of Knowledge Quoting accessd-request at databaseadvisors.com: > Date: Mon, 24 Apr 2006 08:59:09 +1200 > From: David Emerson <newsgrps at dalyn.co.nz> > Subject: [AccessD] VB.Net labels Collection > To: accessd at databaseadvisors.com > Message-ID: <7.0.1.0.0.20060424080437.01a39660 at dalyn.co.nz> > Content-Type: text/plain; charset="us-ascii"; format=flowed > > I have found a partial solution: > > Dim myControl1 As Control, myInt As Integer, lblLoop As Label > For myInt = 1 To 3 > myControl1 = Page.FindControl("lblYrEnd" & myInt) > If (Not myControl1 Is Nothing) Then > lblLoop = CType(myControl1, Label) > lblLoop.Text = "Label No: " & myInt > End If > Next myInt > > This appends the value of myInt to the value entered into TextBox2 > and puts the result into the lblYrEnd label with the last character > equal to myInt. > > I can get this to work in a plain aspx page. However, the page I > want to use it on has a Master page and content control. When I run > the same code the "myControl1 = Page.FindControl("lbltemp" & myInt)" > line doesn't find the control. My guess is that it is because it is > hidden down the control hierarchy but I am having trouble with VB.Net > help finding how to reference them. Can anyone help? > > The code for the objects is: > > <%@ Page Language="VB" MasterPageFile="~/MasterPage.master" > AutoEventWireup="false" CodeFile="pgeSingleItemResult.aspx.vb" > Inherits="pgeSingleItemResult" title="Untitled Page" %> > <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" > Runat="Server"> > <table style="z-index: 100; left: 237px; width: 713px; position: > absolute; top: 217px; vertical-align: top; font-family: arial; > border-collapse: separate; text-align: center; border-right: black > 1px solid; border-top: black 1px solid; border-left: black 1px solid; > border-bottom: black 1px solid;" cellspacing="0" id="tblItemResult"> > <tr> > <td align="center" style="width: 21px; height: 20px;" > bordercolor="black"> > <asp:Label ID="lblYrEnd1" runat="server" > Width="96px"></asp:Label></td> > </tr> > <tr> > <td align="center" style="width: 21px" bordercolor="black"> > <asp:Label ID="lblYrEnd2" runat="server" > Width="96px"></asp:Label></td> > </tr> > <tr> > <td align="center" style="width: 21px" bordercolor="black"> > <asp:Label ID="lblYrEnd3" runat="server" > Width="96px"></asp:Label></td> > </tr> > <tr> > <td align="center" style="width: 21px" bordercolor="black"> > <asp:Label ID="lblYrEnd4" runat="server" > Width="96px"></asp:Label></td> > </tr> > <tr> > <td align="center" style="width: 21px" bordercolor="black"> > <asp:Label ID="lblYrEnd5" runat="server" > Width="96px"></asp:Label></td> > </tr> > </table> > </asp:Content> > > > Regards > > David Emerson > Dalyn Software Ltd > New Zealand > > ------------------------------ > Date: Mon, 24 Apr 2006 09:20:17 +1200 > From: David Emerson <newsgrps at dalyn.co.nz> > Subject: [AccessD] VB.Net labels Collection > To: accessd at databaseadvisors.com > Message-ID: <7.0.1.0.0.20060424091929.01bad030 at dalyn.co.nz> > Content-Type: text/plain; charset="us-ascii"; format=flowed > > If anyone wants a small vb.Net project sample to see if they can find > out why it is not working I can send it to them. > > Regards > > David Emerson > Dalyn Software Ltd > New Zealand