473,399 Members | 3,106 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,399 software developers and data experts.

Paging controls won't show up when using FormView

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:D}")
%>'/>
</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
nj********@hotmail.com
http://www.nathansokalski.com/
Jan 18 '07 #1
0 976

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Patrick.O.Ige | last post by:
Hi Guys, I have a datagrid wit editing and updating. But after adding Paging IT WON'T PAGE!! It compiles well but when i click on the paging link it doesn't go to the next link.. When i remove...
0
by: John Smith | last post by:
ASP.Net 2.0 / C# / IIS 6 I have 2 pages. The master page consists of a tabbed menu created using the Menu and MultiView controls. Something like this: ...
0
by: ThePurpleCat | last post by:
Hi, I'm a newbie to ASP.NET programming but not to Visual Studio. I'm having trouble getting my Master-Details page to work. I have a page enabled GridView which is linked to a FormView control...
2
by: Nathan Sokalski | last post by:
I am trying to create a FormView controls in which I access and modify the the controls in the PagerTemplate programmatically. However, I continue to recieve the following error: Object...
0
by: Nathan Sokalski | last post by:
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"...
6
by: Nathan Sokalski | last post by:
I have tried everything I can think of, I have even tried copying examples from books and websites I have found, but every Formview control that I have tried to create does not show the Paging...
2
by: rn5a | last post by:
In a shopping cart app, a ASPX page retrieves the order details & personal details of a user from a MS-Access database table depending upon the username of the user. The order details of a...
1
by: DAnDA | last post by:
Hey i binding gridview/formview using one sqlDataSource,, that mean formview show all details from gridview selected row,,, now i cant use paging property for formview ,,, can anyone show me how to...
0
by: Jonathan Wood | last post by:
Okay, so I'm trying to isolate some of the bugs I'm seeing with the Personal Website Starter Kit, since I'm apparently the only one on the planet who it does not work for. (I'm using VS2008, .NET...
4
by: pankajsingh5k | last post by:
Hi guys, These question is for all the experts... Please help me before my brain explodes The problem is again with the formview control.. I have a formview and i have to use it that...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.