0

I have to implement the data paging to the datalist I have in my existing application.

What I have

Stored procedure - which has if else condition

If(Seacrh Criteria) 
     Select based on Search Criteria
Else
     Select every product

Now, I want to implement data paging in the datalist I have on aspx page. The problem is that I need to specify the ObjectDataSource to the stored procedure which is bound to the grid view.

I don't want to take any parameter from the querystring. As I have multiple seacrh parameter, the other reason is that I don't want postback.

Might be my explanation is confusing because I want to explain each and everything.

I will try to summarize it:

  • I have a datalist control.
  • I want data paging by using the existing stored procedure.
  • I have already created a dataset [by Add new Item] for the stored procedure. [Product.xsd]
  • I don't want to take any parameter from Querystring, I need almost 15 parameter which I have to take from server side.
  • My stored procedure is ready..Followed by this tutorial
  • What should I write in the TypeName attribute of the ObjectDataSource?

Edit1

I have a seen a better example with Linq to Sql but my issue is that my stored procedure is too big that it can not be transformed into linq query. Any help ?

Chris
  • 2,293
  • 11
  • 48
  • 86

2 Answers2

0

You should be able to use Session variables with your datasource instead of QueryString. You may need to write some code to take your search criteria and put them into session variables.

There's really no way to avoid postback. You can mitigate the page refresh by using ajax.

matt eisenberg
  • 183
  • 6
  • 21
0

You could a look at http://www.liberty.co.uk/fcp/categorylist/dept/liberty-of-london_womenswear. quite interestingly they use client side filtering by embedding the options in the cssclass.

Mike Miller
  • 16,195
  • 1
  • 20
  • 27
  • in your example for paging, you could use jQuery to select all elements with class page1 and make them visible, then when the user clicks page two make those visible. – Mike Miller Jun 09 '11 at 17:41