|
using System;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!this.IsPostBack)
{
this.gvEmployees.DataBind();
}
}
protected void odsEmployee_Selecting(object sender, ObjectDataSourceSelectingEventArgs e)
{
e.InputParameters["connectionString"] = ConfigurationManager.ConnectionStrings["AdventureWorksConnectionString"].ConnectionString;
e.InputParameters["PageNumber"] = this.hfPageNumber.Value;
}
protected void LinkButton1_Click(object sender, EventArgs e)
{
if (Convert.ToInt32(this.hfPageNumber.Value) <= 20)
{
this.hfPageNumber.Value = (Convert.ToInt32(this.hfPageNumber.Value) + 1).ToString();
}
else
{
this.hfPageNumber.Value = "1";
}
this.gvEmployees.DataBind();
}
protected void gvEmployees_DataBound(object sender, EventArgs e)
{
if (this.gvEmployees.Rows.Count > 0)
{
gvEmployees.UseAccessibleHeader = true;
gvEmployees.HeaderRow.TableSection = TableRowSection.TableHeader;
gvEmployees.FooterRow.TableSection = TableRowSection.TableFooter;
}
}
protected void LinkButton2_Click(object sender, EventArgs e)
{
this.hfPageNumber.Value = "1";
this.hfIsDebug.Value = this.CheckBoxList1.Items[0].Selected.ToString().ToLower();
this.hfInitialSortByColumnIndex.Value = this.DropDownList1.SelectedValue;
this.gvEmployees.CssClass = this.RadioButtonList1.SelectedValue;
this.gvEmployees.DataBind();
}
}
|
By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.
If a file you wish to view isn't highlighted, and is a text file (not binary), please
let us know and we'll add colourisation support for it.
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.