Click here to Skip to main content
15,890,670 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
C#
protected void Gridview1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
   GridView1.PageIndex = e.NewPageIndex;
   GridView1.DataSoure = GetSource();
   GridView1.DataBind();

}

The name 'GetSource' does not exist in the current context
'System.Web.UI.WebControls.GridView' does not contain a definition for 'DataSoure' and no extension method 'DataSoure' accepting a first argument of type 'System.Web.UI.WebControls.GridView' could be found (are you missing a using directive or an assembly reference?
Posted
v2
Comments
Please have a look at my answer. :)
Madhu Nair 25-Sep-13 5:31am    
Post your GetSource() method
Please have a look at my answer. :)

1 solution

Problem
It is a typo mistake.

Solution
That is DataSource, not DataSoure.
In your code "c" is missing.

So. code will be like...
C#
protected void Gridview1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
   GridView1.PageIndex = e.NewPageIndex;
   GridView1.DataSource = GetSource();
   GridView1.DataBind();
}


Also make sure that you have GetSource() function.
 
Share this answer
 
Comments
Dholakiya Ankit 25-Sep-13 7:15am    
yes mine 5+ good one
Thanks a lot dholakiya ankit... :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900