Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > FormView - Paging

Reply
Thread Tools

FormView - Paging

 
 
DesCF
Guest
Posts: n/a
 
      08-09-2007

I have programatically created a DataSet (mdsShippers) that consists of a
single DataTable - the Shippers table from Northwind. I have then added a
FormView control to my WebForm and then two text-boxes in the ItemTemplate
(txShipperID and txtCompanyName). In order to get the FormView to display
and page through the records properly I have written the sode shown
below. However, I have arrived at it through experimentation without
really knowing what I am doing. My question is, am I doing what I am
doing right ?


Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load

If Not Page.IsPostBack Then
bdl_LoadShips() ' Creates DataSet and populates DataTable
Else
Me.mdsShippers = Session("Shippers")
End If

With Me.fvShippers
.DataSource = Me.mdsShippers.Tables("dtShippersLIST")
.DataBind()
End With

End Sub

Protected Sub fvShippers_PageIndexChanging(ByVal sender As Object, ByVal
e As System.Web.UI.WebControls.FormViewPageEventArgs) Handles
fvShippers.PageIndexChanging

Me.fvShippers.PageIndex = e.NewPageIndex
Me.fvShippers.DataBind()

End Sub

Protected Sub Page_Unload(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Unload

Session("Shippers") = Me.mdsShippers

End Sub


--








--
Using Opera's revolutionary e-mail client: http://www.opera.com/mail/
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Formview within Formview Chris ASP .Net 0 05-19-2007 04:12 PM
Why can't I get the FormView control's Paging controls to show? Nathan Sokalski ASP .Net 6 01-23-2007 05:42 AM
Paging controls won't show up when using FormView Nathan Sokalski ASP .Net 0 01-18-2007 10:34 PM
Master-Details with GridView and FormView and Paging ThePurpleCat ASP .Net 0 10-18-2006 03:26 PM
FormView/Repeater/ Eval(FormView data) David Thielen ASP .Net Web Controls 2 06-16-2006 07:56 PM



Advertisments