ASP.NET - how to use currency manager in asp.net

Asked By aman on 24-Nov-11 06:24 AM
hello friends,
i have created a page which has previous,next option so i want to use currency manger as we can use in windows application...
so please help how i can do the same in asp.net....


thanks,
regards,
dipa ahuja replied to aman on 24-Nov-11 06:31 AM
In websites you can use the gridview with paging

Here is the simple example of gridview paging:
 
Set the AllowPaging = True for gridview and write this code in codebehind
 
protected void Page_Load(object sender, EventArgs e)
{
   if (!IsPostBack)
   {
     bindGrid();
   }
}
void bindGrid()
{
   SqlDataAdapter da = new SqlDataAdapter("select * from TableName", "Connection String");
   DataTable dt = new DataTable();   
  da.Fill(dt);
   GridView1.DataSource = dt;
   GridView1.DataBind();
}
 
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
   GridView1.PageIndex = e.NewPageIndex;
   BindGrid();
   //Bind Grid
}
 
 
Jitendra Faye replied to aman on 24-Nov-11 06:34 AM
Follow this link-

http://www.codeproject.com/KB/database/CurrencyMangersCollection.aspx

Here you will get article about this.
Reena Jain replied to aman on 24-Nov-11 06:34 AM
hi,

ASP.NET doesn't have anything similar to CurrencyManager: all concepts are different over there. I think the first thing you have to realize is the web and a desktop application are completely different animals. There is not really the same sense of databinding on the web as there is for a desktop application because the web is a stateless medium. This means the server sends marked up text to the client or browser upon each request and they are all independant of each other.
kalpana aparnathi replied to aman on 24-Nov-11 01:44 PM
hi,

    CurrencyManager is a WinForms feature.You cannot (and don't need to) use it in ASP.Net.