Asp .Net TabContainer is useful for multi view purpose via clicking its Tab Panels.
The idea is using two TabPanels as containers for Entry form and list view. The first Tab Panel contains Entry Form and second for List View as we can see at above screen shots.
I use simple Northwind Database and Products Table to create Entry and View to this table.
Asp .Net TabContainer Basic
We must add reference to Asp .Net Ajax Control Toolkit since TabContainer Control is inside it.
Basic TabContainer is already created with simple above Asp .Net Script. You can switch between TabPanels but these still contains nothing.
A web page is about to show a data. This data may generate from database or other object like an class instance.
Mostly, data is presented to a table and a lot of tutorial about making a table that I have is related to database. Developers have a listview / gridview / repeater etc for data view and sqldatasource control as a data source.
Although sqldatasource is good and may increase productivity. An organisation is not always use SQL Server and one of their web tables may not use database at all.
So I prefer to use ObjectDataSource control. This control is more generic data source because we use our own bare class to return a DataTable instance. Since we write our own class then inside it we can code an operation to any RDBMS or work with any objects.
ObjectDataSource control is also good option to retrieve data via Web Service from another Server and maybe that Server is located at different site. We cant see any code like database connection in Web Service but only class and namespace reference of it. Although maybe there is a database operation inside Web Service itself.
In this blog post, I generate the data manualy to DataTable in the first example and secondly, I generate it from webservice and database. Both of them show data via listview and use arbitrary class that I make. ObjectDatasource acts as bridge between this custom class instance and listview.
Adding Data Manualy to DataTable
Here’s the example:
I will show simple table that has persons info with their name, city and province.
.aspx file (piece of code):
Posted in ASP .Net
Tagged ASP .Net, Asp Placeholder, DataColumn, DataRow, DataTable, ItemTemplate, LayoutTemplate, ListView, ObjectDataSource, SelectMethod, TypeName, WebService
Retrieve parts of recordset on web request is a very common task. Trivial method using SqlDataSource as Data Connector and GridView or List View with Data Pager Control to view recordset and its page.
Web request resulting million records will degrade performance even though developer break down onto pages. According to some experiments there is a better way than usual method to do web paging.
Please check these links http://www.4guysfromrolla.com/articles/031506-1.aspx, http://www.4guysfromrolla.com/webtech/042606-1.shtml
The best performance using record ranking method and fortunately start from SQL Server 2005 it has record ranking function
In earlier post about SQL Server Row_Number() function, I have explained how to code and the function’s result on sql.
To do custom paging on web, we need ObjectDataSource because it has attributes like
MaximumRowsParameterName, etc which are enabled us to write a code / class that handles web paging behaviour.
We can write any database operation on methods inside ObjectDataSource so that makes ObjectDataSource flexible.
Other common component on ASP .Net like SqlDataSource is only work for SQL Server and does not has default custom paging capabilities.