Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Setting a Formview record
Message
 
 
À
11/06/2008 15:56:06
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires Web
Divers
Thread ID:
01323266
Message ID:
01323331
Vues:
11
I don't know, but would something like setting DataKey work?

>Does anyone here know how to position a formview to a specific record? I have the following code:
>
>    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
>        Dim i As Int32
>        Dim CurrentRecord As Integer = Session("CurrentPerson")
>
>        If Not IsPostBack() And CurrentRecord > 0 Then
>            FormView1.DataBind()
>
>            ' Go to the record we want
>            For i = 0 To FormView1.DataItemCount - 1
>                FormView1.PageIndex = i
>
>                If FormView1.DataItem("personID") = CurrentRecord Then
>                    Exit For
>                End If
>            Next
>        End If
>           End Sub
>
>which works when placed in the Formview prerender (but it takes forever) and does not work in the PageLoad. This seems like it should be a trivial task but I just can't seem to get it. Any help appreciated.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform