Friday, December 21, 2012

loading the data to muliple Repeater by passing parameter

loading the data to muliple Repeater by passing parameter

this method application for controls such as Dropdown , gridview , report and many



private void LoadSubCourse(String Courses, Repeater Repeater)
        {
            try
            {
                DataTable _dt = new DataTable();
                _dt = objsubCourse.SubCourseDetail(Int32.Parse(Session["CustomerId"].ToString()), Courses);
                if (_dt != null && _dt.Rows.Count > 0)
                {

                    Repeater.DataSource = _dt;
                    Repeater.DataBind();
                }
                else
                {

                }
            }
            catch { }
        }  

calling this method by passing Different It

rpData1,rpData2,rpData adn rpDataOther are the Repeaters
Page Load()
{
                LoadSubCourse("BANK" ,rpData);
                LoadSubCourse("MPSC",rpData1);
                LoadSubCourse("CRT", rpData2);
                LoadSubCourse("", rpDataOther); 
}

No comments:

Post a Comment