473,748 Members | 2,502 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Control names within a repeater

Hello,

I have a repeater control that does the following on the ItemDataBound
event. It works perfectly, except that when it prints out, the names of the
controls
aren't what I'd expect.

lstYes.ID = "lstY" & drvTemp("UserID ") 'Assuming ID is the part we want form
the DB

I use that to set the ID of the listBox, but when it comes to the screen it
has a name of

rptSecurity:ctr l00:lstYes14

Or something similar to that.

Is there a way to make that control just have lstYes14?
If Not e.Item.DataItem Is Nothing Then
Try
Dim intTypeID = CInt(Request.Qu eryString.Get(" TypeID"))
Dim objItemType As ItemType
objItemType = New ItemType(CInt(i ntTypeID))

'Get the current item that's being bound from the DB
Dim drvTemp As DataRowView = CType(e.Item.Da taItem, DataRowView)
'Get handles on the server side controls so we can edit them through
code. l337 pwn4g3
Dim lstYes As ListBox = CType(e.Item.Fi ndControl("list Yes"),
ListBox)
Dim lstNo As ListBox = CType(e.Item.Fi ndControl("list No"), ListBox)
Dim lblButtons As Label = CType(e.Item.Fi ndControl("Labe lButtons"),
Label)
Dim lblName As Label = CType(e.Item.Fi ndControl("Labe lName"), Label)
lstYes.ID = "lstY" & drvTemp("UserID ") 'Assuming ID is the part we
want form the DB
lstYes.Selectio nMode = ListSelectionMo de.Multiple
lstNo.ID = "lstN" & drvTemp("UserID ") 'Assuming ID is the part we
want form the DB
lstNo.Selection Mode = ListSelectionMo de.Multiple
lblName.Text = drvTemp("FullNa me")
'Response.Write (drvTemp("FullN ame") & "<BR>")
For i As Integer = 0 To objItemType.Lay out.Count() - 1
lstYes.Items.Ad d(objItemType.L ayout.Item(i).F ield.Caption())
lstYes.Items(i) .Value = objItemType.Lay out.Item(i).Fie ld.FieldID
Next

'Put raw HTML into the Label control to build the 4 button table to move
items between the list boxes.
'To switch the items between listboxes
'onclick="Switc hList(document. getElementById( 'lstNotifyAvail able'),
document.getEle mentById('lstNo tifySelected')) ;AdNotify(docum ent.getElementB y
Id('lstNotifyAv ailable'));
With lblButtons
Text = "<table>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Allow All"" name=""btn" & drvTemp("UserID ") & "AA""
onclick=""Switc hList(document. getElementById( '" & lstYes.ID.ToStr ing & "'),
document.getEle mentById ('" & lstNo.ID.ToStri ng &
"'));AddNotify( document.getEle mentById('" & lstYes.ID.ToStr ing() & "'));"">"
.Text &= "</td></tr>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Allow"" name=""btn" & drvTemp("UserID ") & "A""
onclick=""Allow (document.Secur ity." & lstYes.ID.ToStr ing() &
",document.Secu rity." & lstNo.ID.ToStri ng() & ");"">"
.Text &= "</td></tr>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Disallo w All"" name=""btn" & drvTemp("UserID ") & "DA""
onclick=""DisAl l(document.Secu rity." & lstYes.ID.ToStr ing() &
",document.Secu rity." &
lstNo.ID.ToStri ng() & ");"">"
.Text &= "</td></tr>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Disallo w"" name=""btn" & drvTemp("UserID ") & "D""
onclick=""Disal low(document.Se curity." & lstYes.ID.ToStr ing() &
",document.Secu rity." &
lstNo.ID.ToStri ng() & ");"">"
.Text &= "</td></tr>"
.Text &= "</table>"
End With

Catch ex As Exception
Debug.WriteLine (ex.ToString)
Response.Write( "<BR>__________ _____________<B R>" & ex.ToString &
"<BR>")
Response.Flush( )
End Try

End If
Nov 18 '05 #1
4 1913
Hi,

no there isn't. ASP.NET gives controls the IDs based on their location in
control hierarchy and if control is contained in a naming container, which
RepeaterItem is, it is named in new scope (scope of the repeaterItem where
it is contained) and named according to that. This way it is ensured that
every control has unique ID on the Page.

What's the issue with this? You can get reference to the control via the
RepeaterItem (callint RepeaterItem's FindControl method) and there you could
use plain ID (lstYes14). If you need the ID at client-side, you can get it
with controls ClientID property which returns the unique ID as
clientscript-friendly. Also you can locate the control from top-level
control (outside the Repeater) by using Page.FindContro l and assigning the
complete unique ID string, though seems that you are not looking for that.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke

"Ryan Ternier" <rt******@icomp asstech.com.spa mproof> wrote in message
news:uj******** ******@TK2MSFTN GP11.phx.gbl...
Hello,

I have a repeater control that does the following on the ItemDataBound
event. It works perfectly, except that when it prints out, the names of the controls
aren't what I'd expect.

lstYes.ID = "lstY" & drvTemp("UserID ") 'Assuming ID is the part we want form the DB

I use that to set the ID of the listBox, but when it comes to the screen it has a name of

rptSecurity:ctr l00:lstYes14

Or something similar to that.

Is there a way to make that control just have lstYes14?
If Not e.Item.DataItem Is Nothing Then
Try
Dim intTypeID = CInt(Request.Qu eryString.Get(" TypeID"))
Dim objItemType As ItemType
objItemType = New ItemType(CInt(i ntTypeID))

'Get the current item that's being bound from the DB
Dim drvTemp As DataRowView = CType(e.Item.Da taItem, DataRowView)
'Get handles on the server side controls so we can edit them through code. l337 pwn4g3
Dim lstYes As ListBox = CType(e.Item.Fi ndControl("list Yes"),
ListBox)
Dim lstNo As ListBox = CType(e.Item.Fi ndControl("list No"), ListBox) Dim lblButtons As Label = CType(e.Item.Fi ndControl("Labe lButtons"), Label)
Dim lblName As Label = CType(e.Item.Fi ndControl("Labe lName"), Label)

lstYes.ID = "lstY" & drvTemp("UserID ") 'Assuming ID is the part we
want form the DB
lstYes.Selectio nMode = ListSelectionMo de.Multiple
lstNo.ID = "lstN" & drvTemp("UserID ") 'Assuming ID is the part we
want form the DB
lstNo.Selection Mode = ListSelectionMo de.Multiple
lblName.Text = drvTemp("FullNa me")
'Response.Write (drvTemp("FullN ame") & "<BR>")
For i As Integer = 0 To objItemType.Lay out.Count() - 1
lstYes.Items.Ad d(objItemType.L ayout.Item(i).F ield.Caption())
lstYes.Items(i) .Value = objItemType.Lay out.Item(i).Fie ld.FieldID Next

'Put raw HTML into the Label control to build the 4 button table to move
items between the list boxes.
'To switch the items between listboxes
'onclick="Switc hList(document. getElementById( 'lstNotifyAvail able'),
document.getEle mentById('lstNo tifySelected')) ;AdNotify(docum ent.getElementB y Id('lstNotifyAv ailable'));
With lblButtons
Text = "<table>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Allow All"" name=""btn" & drvTemp("UserID ") & "AA""
onclick=""Switc hList(document. getElementById( '" & lstYes.ID.ToStr ing & "'), document.getEle mentById ('" & lstNo.ID.ToStri ng &
"'));AddNotify( document.getEle mentById('" & lstYes.ID.ToStr ing() & "'));"">" .Text &= "</td></tr>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Allow"" name=""btn" & drvTemp("UserID ") & "A""
onclick=""Allow (document.Secur ity." & lstYes.ID.ToStr ing() &
",document.Secu rity." & lstNo.ID.ToStri ng() & ");"">"
.Text &= "</td></tr>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Disallo w All"" name=""btn" & drvTemp("UserID ") & "DA""
onclick=""DisAl l(document.Secu rity." & lstYes.ID.ToStr ing() &
",document.Secu rity." &
lstNo.ID.ToStri ng() & ");"">"
.Text &= "</td></tr>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Disallo w"" name=""btn" & drvTemp("UserID ") & "D""
onclick=""Disal low(document.Se curity." & lstYes.ID.ToStr ing() &
",document.Secu rity." &
lstNo.ID.ToStri ng() & ");"">"
.Text &= "</td></tr>"
.Text &= "</table>"
End With

Catch ex As Exception
Debug.WriteLine (ex.ToString)
Response.Write( "<BR>__________ _____________<B R>" & ex.ToString &
"<BR>")
Response.Flush( )
End Try

End If

Nov 18 '05 #2
The issue i'm having is my repeater will be repeating multiple sets of 2
list boxes.

I'm using client side JS to move items from 1 listbox to the other, for each
repeating.

I didn't know you could grab the ClientID property... i'll have to look into
that, and see if I can get that to work.

Thanks!
"Teemu Keiski" <jo****@aspalli ance.com> wrote in message
news:eB******** ******@tk2msftn gp13.phx.gbl...
Hi,

no there isn't. ASP.NET gives controls the IDs based on their location in
control hierarchy and if control is contained in a naming container, which
RepeaterItem is, it is named in new scope (scope of the repeaterItem where
it is contained) and named according to that. This way it is ensured that
every control has unique ID on the Page.

What's the issue with this? You can get reference to the control via the
RepeaterItem (callint RepeaterItem's FindControl method) and there you could use plain ID (lstYes14). If you need the ID at client-side, you can get it
with controls ClientID property which returns the unique ID as
clientscript-friendly. Also you can locate the control from top-level
control (outside the Repeater) by using Page.FindContro l and assigning the
complete unique ID string, though seems that you are not looking for that.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke

"Ryan Ternier" <rt******@icomp asstech.com.spa mproof> wrote in message
news:uj******** ******@TK2MSFTN GP11.phx.gbl...
Hello,

I have a repeater control that does the following on the ItemDataBound
event. It works perfectly, except that when it prints out, the names of

the
controls
aren't what I'd expect.

lstYes.ID = "lstY" & drvTemp("UserID ") 'Assuming ID is the part we want

form
the DB

I use that to set the ID of the listBox, but when it comes to the screen

it
has a name of

rptSecurity:ctr l00:lstYes14

Or something similar to that.

Is there a way to make that control just have lstYes14?
If Not e.Item.DataItem Is Nothing Then
Try
Dim intTypeID = CInt(Request.Qu eryString.Get(" TypeID"))
Dim objItemType As ItemType
objItemType = New ItemType(CInt(i ntTypeID))

'Get the current item that's being bound from the DB
Dim drvTemp As DataRowView = CType(e.Item.Da taItem, DataRowView)
'Get handles on the server side controls so we can edit them

through
code. l337 pwn4g3
Dim lstYes As ListBox = CType(e.Item.Fi ndControl("list Yes"),
ListBox)
Dim lstNo As ListBox = CType(e.Item.Fi ndControl("list No"),

ListBox)
Dim lblButtons As Label =

CType(e.Item.Fi ndControl("Labe lButtons"),
Label)
Dim lblName As Label = CType(e.Item.Fi ndControl("Labe lName"),

Label)


lstYes.ID = "lstY" & drvTemp("UserID ") 'Assuming ID is the part we want form the DB
lstYes.Selectio nMode = ListSelectionMo de.Multiple
lstNo.ID = "lstN" & drvTemp("UserID ") 'Assuming ID is the part we want form the DB
lstNo.Selection Mode = ListSelectionMo de.Multiple
lblName.Text = drvTemp("FullNa me")
'Response.Write (drvTemp("FullN ame") & "<BR>")
For i As Integer = 0 To objItemType.Lay out.Count() - 1
lstYes.Items.Ad d(objItemType.L ayout.Item(i).F ield.Caption())
lstYes.Items(i) .Value =

objItemType.Lay out.Item(i).Fie ld.FieldID
Next

'Put raw HTML into the Label control to build the 4 button table to move
items between the list boxes.
'To switch the items between listboxes
'onclick="Switc hList(document. getElementById( 'lstNotifyAvail able'),

document.getEle mentById('lstNo tifySelected')) ;AdNotify(docum ent.getElementB y
Id('lstNotifyAv ailable'));
With lblButtons
Text = "<table>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Allow All"" name=""btn" & drvTemp("UserID ") & "AA""
onclick=""Switc hList(document. getElementById( '" & lstYes.ID.ToStr ing &

"'),
document.getEle mentById ('" & lstNo.ID.ToStri ng &
"'));AddNotify( document.getEle mentById('" & lstYes.ID.ToStr ing() &

"'));"">"
.Text &= "</td></tr>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Allow"" name=""btn" & drvTemp("UserID ") & "A""
onclick=""Allow (document.Secur ity." & lstYes.ID.ToStr ing() &
",document.Secu rity." & lstNo.ID.ToStri ng() & ");"">"
.Text &= "</td></tr>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Disallo w All"" name=""btn" & drvTemp("UserID ") & "DA""
onclick=""DisAl l(document.Secu rity." & lstYes.ID.ToStr ing() &
",document.Secu rity." &
lstNo.ID.ToStri ng() & ");"">"
.Text &= "</td></tr>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Disallo w"" name=""btn" & drvTemp("UserID ") & "D""
onclick=""Disal low(document.Se curity." & lstYes.ID.ToStr ing() &
",document.Secu rity." &
lstNo.ID.ToStri ng() & ");"">"
.Text &= "</td></tr>"
.Text &= "</table>"
End With

Catch ex As Exception
Debug.WriteLine (ex.ToString)
Response.Write( "<BR>__________ _____________<B R>" & ex.ToString &
"<BR>")
Response.Flush( )
End Try

End If


Nov 18 '05 #3
I've had to do this a few times. Here's a code snippet:
<a
href="javascrip t:openWin('<%= tbCompanyName.U niqueID.Replace (":",
"_") %>', '<%= tbCompanyId.Uni queID.Replace(" :", "_") %>')">Find</a>

This code snippet calls a javascript function. Control.UniqueI D gives
you the full name of a control
Shan Plourde

Ryan Ternier wrote:
The issue i'm having is my repeater will be repeating multiple sets of 2
list boxes.

I'm using client side JS to move items from 1 listbox to the other, for each
repeating.

I didn't know you could grab the ClientID property... i'll have to look into
that, and see if I can get that to work.

Thanks!
"Teemu Keiski" <jo****@aspalli ance.com> wrote in message
news:eB******* *******@tk2msft ngp13.phx.gbl.. .

Hi,

no there isn't. ASP.NET gives controls the IDs based on their location in
control hierarchy and if control is contained in a naming container, which
RepeaterIte m is, it is named in new scope (scope of the repeaterItem where
it is contained) and named according to that. This way it is ensured that
every control has unique ID on the Page.

What's the issue with this? You can get reference to the control via the
RepeaterIte m (callint RepeaterItem's FindControl method) and there you

could

use plain ID (lstYes14). If you need the ID at client-side, you can get it
with controls ClientID property which returns the unique ID as
clientscrip t-friendly. Also you can locate the control from top-level
control (outside the Repeater) by using Page.FindContro l and assigning the
complete unique ID string, though seems that you are not looking for that.

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke

"Ryan Ternier" <rt******@icomp asstech.com.spa mproof> wrote in message
news:uj****** ********@TK2MSF TNGP11.phx.gbl. ..

Hello,

I have a repeater control that does the following on the ItemDataBound
event. It works perfectly, except that when it prints out, the names of

the

controls
aren't what I'd expect.

lstYes.ID = "lstY" & drvTemp("UserID ") 'Assuming ID is the part we want

form

the DB

I use that to set the ID of the listBox, but when it comes to the screen

it

has a name of

rptSecurity: ctrl00:lstYes14

Or something similar to that.

Is there a way to make that control just have lstYes14?
If Not e.Item.DataItem Is Nothing Then
Try
Dim intTypeID = CInt(Request.Qu eryString.Get(" TypeID"))
Dim objItemType As ItemType
objItemType = New ItemType(CInt(i ntTypeID))

'Get the current item that's being bound from the DB
Dim drvTemp As DataRowView = CType(e.Item.Da taItem, DataRowView)
'Get handles on the server side controls so we can edit them

through

code. l337 pwn4g3
Dim lstYes As ListBox = CType(e.Item.Fi ndControl("list Yes"),
ListBox)
Dim lstNo As ListBox = CType(e.Item.Fi ndControl("list No"),

ListBox)

Dim lblButtons As Label =

CType(e.Item. FindControl("La belButtons"),

Label)
Dim lblName As Label = CType(e.Item.Fi ndControl("Labe lName"),

Label)

lstYes.ID = "lstY" & drvTemp("UserID ") 'Assuming ID is the part

we

want form the DB
lstYes.Selectio nMode = ListSelectionMo de.Multiple
lstNo.ID = "lstN" & drvTemp("UserID ") 'Assuming ID is the part

we

want form the DB
lstNo.Selection Mode = ListSelectionMo de.Multiple
lblName.Text = drvTemp("FullNa me")
'Response.Write (drvTemp("FullN ame") & "<BR>")
For i As Integer = 0 To objItemType.Lay out.Count() - 1
lstYes.Items.Ad d(objItemType.L ayout.Item(i).F ield.Caption())
lstYes.Items(i) .Value =

objItemType.L ayout.Item(i).F ield.FieldID

Next

'Put raw HTML into the Label control to build the 4 button table to move
items between the list boxes.
'To switch the items between listboxes
'onclick="Sw itchList(docume nt.getElementBy Id('lstNotifyAv ailable'),
document.getEl ementById('lstN otifySelected') );AdNotify(docu ment.getElement By

Id('lstNotif yAvailable'));
With lblButtons
Text = "<table>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Allo w All"" name=""btn" & drvTemp("UserID ") & "AA""
onclick=""Sw itchList(docume nt.getElementBy Id('" & lstYes.ID.ToStr ing &

"'),

document.getEle mentById ('" & lstNo.ID.ToStri ng &
"'));AddNoti fy(document.get ElementById('" & lstYes.ID.ToStr ing() &

"'));"">"

.Text &= "</td></tr>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Allo w"" name=""btn" & drvTemp("UserID ") & "A""
onclick=""Al low(document.Se curity." & lstYes.ID.ToStr ing() &
",document.S ecurity." & lstNo.ID.ToStri ng() & ");"">"
.Text &= "</td></tr>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Disa llow All"" name=""btn" & drvTemp("UserID ") & "DA""
onclick=""Di sAll(document.S ecurity." & lstYes.ID.ToStr ing() &
",document.S ecurity." &
lstNo.ID.ToStri ng() & ");"">"
.Text &= "</td></tr>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Disa llow"" name=""btn" & drvTemp("UserID ") & "D""
onclick=""Di sallow(document .Security." & lstYes.ID.ToStr ing() &
",document.S ecurity." &
lstNo.ID.ToStri ng() & ");"">"
.Text &= "</td></tr>"
.Text &= "</table>"
End With

Catch ex As Exception
Debug.WriteLine (ex.ToString)
Response.Write( "<BR>__________ _____________<B R>" & ex.ToString &
"<BR>")
Response.Flush( )
End Try

End If




Nov 18 '05 #4
You don't need to do those replaces at all if you'd use ClientID property
instead of UniqueID...

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke
"Shan Plourde" <------@---.net> wrote in message
news:9h******** ************@tw ister01.bloor.i s.net.cable.rog ers.com...
I've had to do this a few times. Here's a code snippet:
<a
href="javascrip t:openWin('<%= tbCompanyName.U niqueID.Replace (":",
"_") %>', '<%= tbCompanyId.Uni queID.Replace(" :", "_") %>')">Find</a>

This code snippet calls a javascript function. Control.UniqueI D gives
you the full name of a control
Shan Plourde

Ryan Ternier wrote:
The issue i'm having is my repeater will be repeating multiple sets of 2
list boxes.

I'm using client side JS to move items from 1 listbox to the other, for eachrepeating.

I didn't know you could grab the ClientID property... i'll have to look intothat, and see if I can get that to work.

Thanks!
"Teemu Keiski" <jo****@aspalli ance.com> wrote in message
news:eB******* *******@tk2msft ngp13.phx.gbl.. .

Hi,

no there isn't. ASP.NET gives controls the IDs based on their location incontrol hierarchy and if control is contained in a naming container, whichRepeaterIte m is, it is named in new scope (scope of the repeaterItem whereit is contained) and named according to that. This way it is ensured thatevery control has unique ID on the Page.

What's the issue with this? You can get reference to the control via the
RepeaterIte m (callint RepeaterItem's FindControl method) and there you

could

use plain ID (lstYes14). If you need the ID at client-side, you can get itwith controls ClientID property which returns the unique ID as
clientscrip t-friendly. Also you can locate the control from top-level
control (outside the Repeater) by using Page.FindContro l and assigning thecomplete unique ID string, though seems that you are not looking for that.
--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
http://blogs.aspadvice.com/joteke

"Ryan Ternier" <rt******@icomp asstech.com.spa mproof> wrote in message
news:uj****** ********@TK2MSF TNGP11.phx.gbl. ..
Hello,

I have a repeater control that does the following on the ItemDataBound
event. It works perfectly, except that when it prints out, the names of

the
controls
aren't what I'd expect.

lstYes.ID = "lstY" & drvTemp("UserID ") 'Assuming ID is the part we want
form
the DB

I use that to set the ID of the listBox, but when it comes to the screen

it
has a name of

rptSecurity: ctrl00:lstYes14

Or something similar to that.

Is there a way to make that control just have lstYes14?
If Not e.Item.DataItem Is Nothing Then
Try
Dim intTypeID = CInt(Request.Qu eryString.Get(" TypeID"))
Dim objItemType As ItemType
objItemType = New ItemType(CInt(i ntTypeID))

'Get the current item that's being bound from the DB
Dim drvTemp As DataRowView = CType(e.Item.Da taItem, DataRowView) 'Get handles on the server side controls so we can edit them
through
code. l337 pwn4g3
Dim lstYes As ListBox = CType(e.Item.Fi ndControl("list Yes"),
ListBox)
Dim lstNo As ListBox = CType(e.Item.Fi ndControl("list No"),
ListBox)
Dim lblButtons As Label =
CType(e.Item. FindControl("La belButtons"),
Label)
Dim lblName As Label = CType(e.Item.Fi ndControl("Labe lName"),
Label)
lstYes.ID = "lstY" & drvTemp("UserID ") 'Assuming ID is the part

we

want form the DB
lstYes.Selectio nMode = ListSelectionMo de.Multiple
lstNo.ID = "lstN" & drvTemp("UserID ") 'Assuming ID is the part

we

want form the DB
lstNo.Selection Mode = ListSelectionMo de.Multiple
lblName.Text = drvTemp("FullNa me")
'Response.Write (drvTemp("FullN ame") & "<BR>")
For i As Integer = 0 To objItemType.Lay out.Count() - 1
lstYes.Items.Ad d(objItemType.L ayout.Item(i).F ield.Caption()) lstYes.Items(i) .Value =
objItemType.L ayout.Item(i).F ield.FieldID
Next

'Put raw HTML into the Label control to build the 4 button table to moveitems between the list boxes.
'To switch the items between listboxes
'onclick="Sw itchList(docume nt.getElementBy Id('lstNotifyAv ailable'),

document.getEl ementById('lstN otifySelected') );AdNotify(docu ment.getElement B

y
Id('lstNotif yAvailable'));
With lblButtons
Text = "<table>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Allo w All"" name=""btn" & drvTemp("UserID ") & "AA""
onclick=""Sw itchList(docume nt.getElementBy Id('" & lstYes.ID.ToStr ing &
"'),
document.getEle mentById ('" & lstNo.ID.ToStri ng &
"'));AddNoti fy(document.get ElementById('" & lstYes.ID.ToStr ing() &
"'));"">"
.Text &= "</td></tr>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Allo w"" name=""btn" & drvTemp("UserID ") & "A""
onclick=""Al low(document.Se curity." & lstYes.ID.ToStr ing() &
",document.S ecurity." & lstNo.ID.ToStri ng() & ");"">"
.Text &= "</td></tr>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Disa llow All"" name=""btn" & drvTemp("UserID ") & "DA""
onclick=""Di sAll(document.S ecurity." & lstYes.ID.ToStr ing() &
",document.S ecurity." &
lstNo.ID.ToStri ng() & ");"">"
.Text &= "</td></tr>"
.Text &= "<tr><td>"
.Text &= "<input type=""button"" class=""BoxType 42""
value=""Disa llow"" name=""btn" & drvTemp("UserID ") & "D""
onclick=""Di sallow(document .Security." & lstYes.ID.ToStr ing() &
",document.S ecurity." &
lstNo.ID.ToStri ng() & ");"">"
.Text &= "</td></tr>"
.Text &= "</table>"
End With

Catch ex As Exception
Debug.WriteLine (ex.ToString)
Response.Write( "<BR>__________ _____________<B R>" & ex.ToString &"<BR>")
Response.Flush( )
End Try

End If



Nov 18 '05 #5

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

Similar topics

2
3202
by: Jorge Ayala | last post by:
Well I'm trying to catch and act upon a button event that is placed within the item template of a repeater control. Yet the code I'm using isn't working. What I've seen out there to explain how to do this is way complicated and assumes a familiarity with dot net that I don't have yet. I'll get it eventually but this is where I'll get it. Here's my code. First part is the user control and second is the code behind page Use control
11
4158
by: Christoph Boget | last post by:
When building a form using Infopath, you can define a repeating section and stick form fields in that section. I'm curious if ASP.NET has a similar control to make it easy to design something similar using just ASP.NET (and not Infopath)? I'd hate to think that I'll need to write all the javascript/dhtml to mimic that functionality and I don't really feel the need to re-invent the wheel. Has MS designed such a control? A 3rd party? ...
1
1404
by: Z D | last post by:
Hello, I have a checkbox control as one of the items within my repeater control. I've set the AutoPostBack=True on the checkbox. How do I access the event (so that I can run some code) whenever someone clicks on the checkbox? Also, how do I determine which checkbox was clicked so that I can run the appropriate code?
3
2863
by: WebMatrix | last post by:
I am struggling with implementing somewhat complicated UI web-control. I explored Repeater, but I am not sure if it's the best way to go. I am leaning towards writing my own custom control and creating elements on the fly dynamically. I have a control that needs to display 3 columns and n number of rows depending on number of records. Sounds simple. But each Row has a control with its own data source binding and value must be selected...
0
1579
by: mike | last post by:
How do i perform a databind on a web user control within a repeater or rather how can I access the datasource that is already bound? I have a web user control that displays a table of values (the profile of a piece of equipment) from SQLServer. I've used a repeater on the webform since a query (i.e. by address) against the DB may return multiple machine profiles and I want to use the repeater to display as many machine profiles as are...
7
5486
by: charliewest | last post by:
Hello - I'm using a Repeater control to render information in a very customized grid-like table. The Repeater control is binded to a DataSet with several records of information. Within the Repeater control, I've placed DropDownLists and CheckBoxes. When the user has updated the information, he/he clicks the submit button which is outside the scope of the Repeater control.
9
4691
by: Jaybuffet | last post by:
my aspx has something like this <asp:Repeater id="Repeater1" runat="server"> <ItemTemplate> <mycontrol:ctl id="ctlId" obj='<%# Container.DataItem %>' showItem="true"/> </ItemTemplate> /asp:Repeater> The DataSource for this Repeater is a CollectionBase of objects and is
8
3026
by: fernandezr | last post by:
I would like to use a user control as a template inside a repeater. Some of the fields in the control should be hidden depending on whether or not there is data. I'm still a ASP .Net newbie so the way I'm going about doing this might be a little off. I'd appreciate some help. Below is the code I have thus far but I'm not sure how to reference the user control within the foreach loop. <asp:Panel ID="pnlRosterProfile" runat="Server" />
7
3006
by: | last post by:
I have what's probably a simple page lifecycle question related to dynamically evaluating values that are placed by a repeater and dynmically placing user controls that use those values. I'm attempting to bind a user control I've written, "ImageBox", to a repeater. The user control takes a custom property, "ContentID", that will execute a database lookup and load an image.
0
8987
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8826
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8239
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
6793
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
4597
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
4867
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3303
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2777
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2211
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.