Author: jfeeney | Posted on: 7/21/2009 7:10:51 AM | Views : 282

 Following an example I built a sample Shopping Cart page that had an internal datatable holding the information for the gridview. However, when I was done the example, I realized I had a problem because what I really needed to be able to do was to add items from my products.aspx page to the datatable and then display the items from the datatable on my Shopping cart page.
So, I am now trying to figure out how to migrate my code for the datatable into a classs. From the App_Code folder I added a new class. I opened the new class up in ClassView. I right clicked ClassView and choose add Method.
To start I am migrating a subroutine from my example shopping cart page called public void makeCart() to a class method called CreateShoppingCartDataTable.
Here is the code from makeCart()
DataTable objDT = new DataTable(); DataRow objDR; protected void Page_Load(object sender, EventArgs e) { if (!I ...

Go to the complete details ...