Gururaj Jewargi

Gururaj Jewargi

  • NA
  • 663
  • 747.1k

How can i access single method into all webpages using class

Oct 24 2016 7:10 AM
Hi,
    here it is small method for binding employee data. i want to access this method into 5 webpages. instead of keeping every page load method i want to access only one method to all webpages how ? ? 
private void BindGridviewData()
{
con.Open();
SqlCommand cmd = new SqlCommand("Bindemployee", con);
cmd.CommandType = CommandType.StoredProcedure;
SqlDataAdapter da = new SqlDataAdapter(cmd);
DataSet ds = new DataSet();
da.Fill(ds);
con.Close();
gvDetails.DataSource = ds;
gvDetails.DataBind();

Answers (3)