Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Custom Paging - How to pass parameters
Message
De
07/06/2009 23:44:37
 
 
À
Tous
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Titre:
Custom Paging - How to pass parameters
Divers
Thread ID:
01404383
Message ID:
01404383
Vues:
123
Hi all,

I'm facing the problem on passing startRowIndex, maximumRows and sortExpression as parameters to my ObjectDataSource SelectMethod after refering to the following articles.

http://aspnet.4guysfromrolla.com/articles/031506-1.aspx

http://www.asp.net/Learn/Data-Access/tutorial-26-vb.aspx

Here are some codes from my web app.

BO Function
Public Function GetMyRecord(ByVal startRowIndex As Integer, ByVal maximumRows As Integer, ByVal sortExpression As String) As DataTable
	'*' Code to retrieve Record from SP
	Return result
End Function
  
Public Function GetMyRecordCount() As Integer
	'*' Code to retrieve Record Count
	Return recordCount
End Function
ASPX
<asp:ObjectDataSource ID="myDataSource" runat="server" SelectMethod="GetMyRecord" 
	TypeName="MyProj.BO.MyTable" EnablePaging="True" 
	SelectCountMethod="GetMyRecordCount" SortParameterName="sortExpression">
	<selectparameters>
		<asp:Parameter Name="startRowIndex" Type="Int32"></asp:Parameter>
		<asp:Parameter Name="maximumRows" Type="Int32"></asp:Parameter>
		<asp:Parameter Name="sortExpression" Type="String"></asp:Parameter>
	</selectparameters>
</asp:ObjectDataSource>
Do I need to manually get the PageIndex and MaxRows from CodeBehind, or there is an easier approach? Also, is the function specified in the the SelectCountMethod must be a function in ASPX code behind?

Kindly advise, thanks
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform