checkbox - What's the best way to show multiple checkboxes for multiple records in ASP.NET -


The situation is as follows:

I have a database with many RSS categories, many RSS Change feed I want them to appear in the following fashion do:

  RSS class 1 [Rs feed [1] [Rs feed 2]] RSS feed [RSS 3 Series 2] Rs feed [1] RSS Feed 2 [] RSS feed 3  

Where [] represents a checkbox

Every RSS feed on the original RSS C Based on the ID is pulled out of the database. I can not use checkboxes because each checkbox should be within an unordered list list item. I think markup should be semantically correct and should not use control adapter.

I control began in two nested Ripitron seen, is a database that database with a list of RSS categories out demonstrate the range header and hide with a class ID, then An internal repeater with the RSS feed for the category.

How do I use the square ID from the hidden area control in the parent repeater so that I can see the correct RSS Feeds?

I think you are looking for something like this:

ASPX: < / P>

  & lt; Asp: Repeater id = "rptOuter" runat = "server" OnItemDataBound = "rptOuter_ItemDataBound" & gt; & Lt; HeaderTemplate & gt; & Lt; Ul style = "list-style-type: none" & gt; & Lt; / HeaderTemplate & gt; & Lt; ItemTemplate & gt; & Lt; Li id = '& lt;% # Eval ("id")% & gt; & Gt; & Lt;% # Eval ("Category")% & gt; & Lt; Asp: Repeater id = "rptInner" runat = "server" & gt; & Lt; HeaderTemplate & gt; & Lt; Ul style = "list-style-type: none" & gt; & Lt; / HeaderTemplate & gt; & Lt; ItemTemplate & gt; & Lt; Li & gt; & Lt; Asp: check box id = "chkFeed" runat = "server" text = '& lt;% # Eval ("feed")% & gt; / & Gt; & Lt; / Li & gt; & Lt; / ItemTemplate & gt; & Lt; FooterTemplate & gt; & Lt; / Ul & gt; & Lt; / FooterTemplate & gt; & Lt; / ASP: Repeater & gt; & Lt; / Li & gt; & Lt; / ItemTemplate & gt; & Lt; FooterTemplate & gt; & Lt; / Ul & gt; & Lt; / FooterTemplate & gt; & Lt; / ASP: Repeater & gt;  

code behind:

  protected void Pej_lod (object sender, Iventaarjis e) {using (SQL connection = new SQL connection (Kanan string)) { Conn.pen (); SqlCommand CMD = New SQL Commands ("SELECT id, range from rsscategory_tbl", con); SqlDataReader rdr = cmd.ExecuteReader (); This.rptOuter.DataSource = rdr; This.rptOuter.DataBind (); Rdr.Close (); }} Safe void rptOuter_ItemDataBound (Object Sender, Repeater EatmAventus E) {if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem} {Use (SqlConnection conn = New SqlConnection (connString) )) {Conn.Open (); System.Data.Common.DbDataRecord rd = (System.Data.Common.DbDataRecord) e.Item.DataItem; Select SQL Command cmd = new SQL feed Command ( "Arssfad_tibiel where class class =" + RD. Gataianti 32 (rd. Gatordinl ( "ID")), Con; repeater RptInner = (repeater) EkItemkFindControl ( "Rptinner"); Skldatareader Rdr = Kand.aksekyutereader (); Rptinnerkdtsurs = Rdr; Rptinnerkdtbind (); Rdrkcloj ();}}}  
Click on

Comments