repeater

Discussion in '.NET' started by Tabriz, Aug 2, 2015.

  1. Tabriz

    Tabriz

    Joined:
    Aug 2, 2015
    Messages:
    1
    Likes Received:
    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>
     
    Tabriz, Aug 2, 2015
    #1
    1. Advertisements

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 (here). After that, you can post your question and our members will help you out.
Similar Threads
  1. Robby
    Replies:
    9
    Views:
    2,953
    smith
    Dec 5, 2004
  2. Matt Jensen

    Nested Repeater with null rows

    Matt Jensen, Jun 28, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    634
    Matt Jensen
    Jun 28, 2005
  3. VIswanathan S

    Data Repeater

    VIswanathan S, Oct 15, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    6,822
    Bob Powell [MVP]
    Oct 15, 2005
  4. chris.reed@digus.com

    Repeater control with nested repeater

    chris.reed@digus.com, Feb 11, 2005, in forum: ASP .Net
    Replies:
    0
    Views:
    1,231
    chris.reed@digus.com
    Feb 11, 2005
  5. rwoo_98@yahoo.com
    Replies:
    0
    Views:
    3,322
    rwoo_98@yahoo.com
    Feb 26, 2005
  6. voidfill3d@yahoo.com

    Repeater inside a repeater....how?

    voidfill3d@yahoo.com, Aug 10, 2005, in forum: ASP .Net
    Replies:
    1
    Views:
    7,362
    Karl Seguin
    Aug 10, 2005
  7. uncensored
    Replies:
    0
    Views:
    1,124
    uncensored
    Oct 25, 2006
  8. Microsoft

    Repeater inside a Repeater

    Microsoft, Aug 21, 2006, in forum: ASP .Net Web Controls
    Replies:
    0
    Views:
    459
    Microsoft
    Aug 21, 2006
Loading...