repeater

Joined
Aug 2, 2015
Messages
1
Reaction score
0
hello
I've a problem with repeater control
I use a repeater for display the database element but I want ،
firt : display the choosen item in the label1
next : when the choose details_link..... display the details on other page of database
but i can't ...
what do I do ??????????????



my code:

Protected Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
For Each rep As RepeaterItem In Repeater1.Items
For Each ctrl As Control In rep.Controls
If ctrl.GetType Is GetType(RadioButton) Then
If DirectCast(ctrl, RadioButton).Checked = True Then
Dim myvarID As String = DirectCast(ctrl, RadioButton).ID
Dim myvarText As String = DirectCast(ctrl, RadioButton).Text

End If
End If
Next
Next

End Sub

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="test_repeater.WebForm1" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div><asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:testConnectionString %>" SelectCommand="SELECT * FROM [T1]"></asp:SqlDataSource>
<asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
<ItemTemplate >

<table >
<td><%#Eval("title")%> </td>
<tr><td> <asp:RadioButton ID="RadioButton1" Text='<%#DataBinder.Eval(Container.DataItem, "g1")%>' runat="server" name="1"/></td></tr>
<tr><td> <asp:RadioButton ID="RadioButton2" Text='<%#DataBinder.Eval(Container.DataItem, "g2")%>' runat="server" name="1"/></td></tr>
<asp:Label ID="Label1" runat="server" Text="Label">choosen Item : </asp:Label>
<asp:HyperLink ID="HyperLink1" runat="server">more details</asp:HyperLink>
</ItemTemplate>
</asp:Repeater>
</div>

<asp:Button ID="Button1" runat="server" Text="Button" />


</form>
</body>
</html>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top