Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP .Net Web Controls > Get Name of the Control inside Repeater

Reply
Thread Tools

Get Name of the Control inside Repeater

 
 
Asif
Guest
Posts: n/a
 
      10-22-2007
Hi all,

I have following repeator control with two controls

<asp:repeater id="rptSurvey" runat="server">
<ItemTemplate>
<asp:RadioButtonList id="Rd" runat="server">
<asp:ListItem Value="1" >Enable</asp:ListItem>
<asp:ListItem Value="2" >Delete</asp:ListItem>
</asp:RadioButtonList>

<asp:LinkButton id="btnUpdate" runat="server">LinkButton</
asp:LinkButton>
</ItemTemplate>
</asp:repeater>

I need to add client side script on Link Button so if user select
Delete Option and click Link button it must be confirm first.

I am trying to add code on ItemDataBoundEvent

If e.Item.ItemType = ListItemType.Item Then
CType(e.Item.FindControl("btnUpdate"),
LinkButton).Attributes.Add("onClick", "return confirm('" &
CType(e.Item.FindControl("Rd"), RadioButtonList).SelectedValue &
"');")
End If

My client side script is

<script language="javascript">
function confirm(id)
{
alert(id);
return false;
}
</script>

But it did not work.

Can anyone please let me know about where I am wrong and how to get
control through client side script inside Repeator Control to do
client side confirmation before updating record?

Thanks

Asif

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Initialization of a Web User Control inside Repeater Control satyajit ASP .Net 2 08-21-2007 03:03 PM
repeater inside a repeater problem. uncensored ASP .Net 0 10-25-2006 06:10 PM
Repeater inside a Repeater Microsoft ASP .Net Web Controls 0 08-21-2006 09:13 AM
Repeater inside a repeater....how? voidfill3d@yahoo.com ASP .Net 1 08-10-2005 01:58 PM
Can you get the record count inside a repeater control? darrel ASP .Net 1 07-01-2004 06:39 PM



Advertisments