Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Paging controls won't show up when using FormView

Reply
Thread Tools

Paging controls won't show up when using FormView

 
 
Nathan Sokalski
Guest
Posts: n/a
 
      01-18-2007
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"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
</head>
<body>
<form id="form1" runat="server">
<asp:FormView ID="fviewTesting" runat="server" AllowPaging="true"
PagerSettings-Visible="true">
<rowstyle HorizontalAlign="Center"/>
<ItemTemplate>
<asp:Image ID="imgPhoto" runat="server" BorderWidth="0px"
ImageAlign="Middle" ImageUrl='<%#
DataBinder.Eval(Container,"DataItem.filename","ima ges/photoalbum/{0}")
%>'/><br/>
<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}")
%>'/>
</ItemTemplate>
</asp:FormView>
</form>
</body>
</html>


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
photodate,filename",
System.Configuration.ConfigurationManager.AppSetti ngs("connectionstring"))
dataadapterSelect.Fill(photoalbum)
Me.fviewTesting.DataSource = photoalbum
Me.fviewTesting.DataBind()
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,
DataRowView)("filename").ToString()
Dim photo As System.Drawing.Image =
System.Drawing.Image.FromFile(MapPath("images/photoalbum/" & currfile))
CType(Me.fviewTesting.FindControl("imgPhoto"), Image).Width =
photo.Width
CType(Me.fviewTesting.FindControl("imgPhoto"), Image).Height =
photo.Height
CType(Me.fviewTesting.FindControl("lblPhotoDate"), Label).Text =
CDate(CType(Me.fviewTesting.DataItem,
DataRowView)("photodate")).ToLongDateString()
End Sub
End Class


What am I doing wrong? Thanks.
--
Nathan Sokalski
http://www.velocityreviews.com/forums/(E-Mail Removed)
http://www.nathansokalski.com/


 
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
Why can't I get the FormView control's Paging controls to show? Nathan Sokalski ASP .Net 6 01-23-2007 05:42 AM
Why can't I get the FormView control's Paging controls to show? Nathan Sokalski ASP .Net Web Controls 6 01-23-2007 05:42 AM
Why can't I get the FormView control's Paging controls to show? Nathan Sokalski ASP .Net Datagrid Control 6 01-23-2007 05:42 AM
Paging controls won't show up when using FormView Nathan Sokalski ASP .Net Web Controls 0 01-18-2007 10:34 PM
web controls paging, sorting and selection from other controls Jason ASP .Net 0 10-04-2006 02:03 PM



Advertisments