Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to add a checkbox to every row when using <asp:xml>?

Status
Not open for further replies.

collegian

Programmer
Jul 1, 2010
64
US
Hello All,

I am using the <asp:xml> control for displaying data obtained from a table.I want to know is it possible to add checkbox to each and every row of data fetched from the table? I can't use a datalist or a repeater since I am exporting data to end-note and I am using a XSLT for that purpose.

Here is my code:

//Front End .aspx file

<TABLE class="content">
<TR>
<TD colSpan="3">
<asp:xml id="xmlPubList" runat="server"></asp:xml></TD>
</TR>
</TABLE>





//Code Behind file


protected void Page_Load(object sender, EventArgs e)
{
conn_str = ConfigurationSettings.AppSettings["OLEDB_CONN_META"];
pubtype_sql = ConfigurationSettings.AppSettings["PUBTYPE_SQL"];
pubyear_sql = ConfigurationSettings.AppSettings["PUBYEAR_SQL"];
pub_sql = ConfigurationSettings.AppSettings["PUB_SQL_ALL"];
pub_sql_order = ConfigurationSettings.AppSettings["PUB_SQL_ORDER"];
pub_xsl_web = ConfigurationSettings.AppSettings["PUB_XSL_WEB"];


if (!Page.IsPostBack)
{

OleDbConnection conn = new OleDbConnection(conn_str);
ds = new DataSet("pubs");

OleDbDataAdapter sda_type = new OleDbDataAdapter(pubtype_sql, conn);
sda_type.Fill(ds, "pubtype");

ddPubType.DataSource = ds.Tables["pubtype"].DefaultView;
ddPubType.DataTextField = "pubType";
ddPubType.DataValueField = "pubTypeID";
ddPubType.DataBind();

OleDbDataAdapter sda_year = new OleDbDataAdapter(pubyear_sql, conn);
sda_year.Fill(ds, "pubyear");

ddPubYear.DataSource = ds.Tables["pubyear"].DefaultView;
ddPubYear.DataTextField = "pubYearD";
ddPubYear.DataValueField = "pubYear";
ddPubYear.DataBind();


//by default only get the most recent two years publication
int currYear = DateTime.Now.Year;
string defaultWhere = " and year(pubdate) >= " + (currYear - 1 + " or inpress = 1");
OleDbDataAdapter sda = new OleDbDataAdapter(pub_sql + defaultWhere + pub_sql_order, conn);


sda.Fill(ds, "publications");
lblInfo.Text = ds.Tables["publications"].Rows.Count + " records";
xmlPubList.DocumentContent = ds.GetXml();
xmlPubList.TransformSource = pub_xsl_web;

}
}




Thanks!



 
try this

<div style="overflow:auto;width:100%;height:100%;border:1px solid #336699;padding-left:5px">
<input type="checkbox" name="wow[]"> ALL Components <br>
<input type="checkbox" name="wow[]"> AC Batch <br>
<input type="checkbox" name="wow[]"> AC Parameter <br>
<input type="checkbox" name="wow[]"> Actuate Entitlement Service <br>
<input type="checkbox" name="wow[]"> Actuate Seamless Login <br>
<input type="checkbox" name="wow[]">Actuate Synchronization Manager<br>
<input type="checkbox" name="wow[]"> Asynchronous Report Manager <br>
<input type="checkbox" name="wow[]"> Asynchronous Report Service <br>
<input type="checkbox" name="wow[]"> FTU Component<br>
<input type="checkbox" name="wow[]"> Mail Merge<br>
<input type="checkbox" name="wow[]"> RSSE <br>
<input type="checkbox" name="wow[]"> Report History Component<br>
</div>
 
Does that mean I need to create a checkbox for every column of the data returned?
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top