By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
459,223 Members | 1,403 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 459,223 IT Pros & Developers. It's quick & easy.

Paging controls won't show up when using FormView

P: n/a
I have a very simple FormView control, but when I view the page it does not
show the Paging controls, although it does show the data. Here is my code:
<%@ Page Language="vb" AutoEventWireup="false"
CodeBehind="FormViewTest.aspx.vb" Inherits="family.FormViewTest" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
<html xmlns="" >
<head runat="server">
<form id="form1" runat="server">
<asp:FormView ID="fviewTesting" runat="server" AllowPaging="true"
<rowstyle HorizontalAlign="Center"/>
<asp:Image ID="imgPhoto" runat="server" BorderWidth="0px"
ImageAlign="Middle" ImageUrl='<%#
DataBinder.Eval(Container,"DataItem.filename","ima ges/photoalbum/{0}")
<asp:Label ID="lblPhotoCaption" runat="server"
AssociatedControlID="imgPhoto" Text='<%#
DataBinder.Eval(Container,"DataItem.caption") %>'/><br/>
<asp:Label ID="lblPhotoDate" runat="server"
AssociatedControlID="imgPhoto" Text='<%#
DataBinder.Eval(Container,"DataItem.photodate","Ph oto taken on: {0:D}")
Partial Public Class FormViewTest : Inherits System.Web.UI.Page
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
Dim photoalbum As New DataTable
Dim dataadapterSelect As New
System.Data.OleDb.OleDbDataAdapter("SELECT * FROM babyphotos ORDER BY
System.Configuration.ConfigurationManager.AppSetti ngs("connectionstring"))
Me.fviewTesting.DataSource = photoalbum
End Sub

Private Sub fviewTesting_PageIndexChanged(ByVal sender As Object, ByVal
e As System.EventArgs) Handles fviewTesting.PageIndexChanged
Dim currfile As String = CType(Me.fviewTesting.DataItem,
Dim photo As System.Drawing.Image =
System.Drawing.Image.FromFile(MapPath("images/photoalbum/" & currfile))
CType(Me.fviewTesting.FindControl("imgPhoto"), Image).Width =
CType(Me.fviewTesting.FindControl("imgPhoto"), Image).Height =
CType(Me.fviewTesting.FindControl("lblPhotoDate"), Label).Text =
End Sub
End Class
What am I doing wrong? Thanks.
Nathan Sokalski
Jan 18 '07 #1
Share this question for a faster answer!
Share on Google+

This discussion thread is closed

Replies have been disabled for this discussion.