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!
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!