I am very new to this c#. I was wondering if someone can help me in this problem... Say for example i have written the following control see code below..Now i want to add a paging (just an example) as another control, which however extend this control. How can i do that. I am trying to do it but it is giving me error. Can anyone correct me please.

public partial class ThmbListing : System.Web.UI.UserControl
{

#region Fields ------------------------------------------------------------------------

public DataSet ds ;
public Icon icon;
private int pagesize = 5;

#endregion

#region Public properties


public int GridPageSize
{
get
{
return this.pagesize;
}
set
{
this.pagesize = value;
this.GridView1.PageSize = value;

}
}


#endregion

#region Public Protected Methods

public string setImagesNullValue(string imageValue)
{
string ImagesValues = "";

if (imageValue != "")
{
ImagesValues = imageValue + "width=150&height=150";
}
else
{
ImagesValues = System.Configuration.ConfigurationManager.AppSettings["URL"] + "/images/imageNotAvailable.gif";
}
return ImagesValues;

}

protected void MyDataBind()
{
try
{
this.ds = new DataSet();
this.icon = new Icon();
SqlConnection cn = new SqlConnection();
cn.ConnectionString = System.Configuration.ConfigurationManager.AppSettings["DBConnectionString"];
SqlDataAdapter da = new SqlDataAdapter("select * from ResidentialListingView", cn);
da.Fill(this.ds);
this.GridView1.DataSource = this.ds;
this.GridView1.DataBind();
cn.Close();
this.ds.Dispose();
}
catch { }



}

protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
//GridPageSize = 5;
MyDataBind();

}

}

protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
ViewState["CurrentPage"] = e.NewPageIndex;
GridView1.PageIndex = e.NewPageIndex;
MyDataBind();
}

protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.Pager)
{

int count = GridView1.PageCount * GridView1.PageSize;
int Totalpropery = this.ds.Tables[0].Rows.Count;
int startRecrod = 0;
int endRecrod = 0;

startRecrod = (GridView1.PageIndex * GridView1.PageSize) + 1;
if (GridView1.PageIndex + 1 == this.GridView1.PageCount)
endRecrod = Totalpropery;
else
endRecrod = (GridView1.PageIndex + 1) * GridView1.PageSize;
lblView.Text = "Viewing : <B>" + startRecrod + "</B> - <B>" + endRecrod + "</B> of <B>" + Totalpropery + "</B>";


}

}

#endregion



}

/////Beolw is i am tryng to extend

public partial class PageOrder :ThmbListing
{

protected void SizeList_SelectedIndexChanged(object sender, EventArgs e)
{
GridPageSize = Convert.ToInt32(SizeList.SelectedItem.Value);
MyDataBind();
}
}