473,795 Members | 2,452 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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="For mViewTest.aspx. vb" Inherits="famil y.FormViewTest" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dt d">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
</head>
<body>
<form id="form1" runat="server">
<asp:FormView ID="fviewTestin g" runat="server" AllowPaging="tr ue"
PagerSettings-Visible="true">
<rowstyle HorizontalAlign ="Center"/>
<ItemTemplate >
<asp:Image ID="imgPhoto" runat="server" BorderWidth="0p x"
ImageAlign="Mid dle" ImageUrl='<%#
DataBinder.Eval (Container,"Dat aItem.filename" ,"images/photoalbum/{0}")
%>'/><br/>
<asp:Label ID="lblPhotoCap tion" runat="server"
AssociatedContr olID="imgPhoto" Text='<%#
DataBinder.Eval (Container,"Dat aItem.caption") %>'/><br/>
<asp:Label ID="lblPhotoDat e" runat="server"
AssociatedContr olID="imgPhoto" Text='<%#
DataBinder.Eval (Container,"Dat aItem.photodate ","Photo taken on: {0:D}")
%>'/>
</ItemTemplate>
</asp:FormView>
</form>
</body>
</html>
Partial Public Class FormViewTest : Inherits System.Web.UI.P age
Protected Sub Page_Load(ByVal sender As Object, ByVal e As
System.EventArg s) Handles Me.Load
Dim photoalbum As New DataTable
Dim dataadapterSele ct As New
System.Data.Ole Db.OleDbDataAda pter("SELECT * FROM babyphotos ORDER BY
photodate,filen ame",
System.Configur ation.Configura tionManager.App Settings("conne ctionstring"))
dataadapterSele ct.Fill(photoal bum)
Me.fviewTesting .DataSource = photoalbum
Me.fviewTesting .DataBind()
End Sub

Private Sub fviewTesting_Pa geIndexChanged( ByVal sender As Object, ByVal
e As System.EventArg s) Handles fviewTesting.Pa geIndexChanged
Dim currfile As String = CType(Me.fviewT esting.DataItem ,
DataRowView)("f ilename").ToStr ing()
Dim photo As System.Drawing. Image =
System.Drawing. Image.FromFile( MapPath("images/photoalbum/" & currfile))
CType(Me.fviewT esting.FindCont rol("imgPhoto") , Image).Width =
photo.Width
CType(Me.fviewT esting.FindCont rol("imgPhoto") , Image).Height =
photo.Height
CType(Me.fviewT esting.FindCont rol("lblPhotoDa te"), Label).Text =
CDate(CType(Me. fviewTesting.Da taItem,
DataRowView)("p hotodate")).ToL ongDateString()
End Sub
End Class
What am I doing wrong? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/
Jan 18 '07 #1
0 1130

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

Similar topics

5
1709
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 AllowCutomPaging it gives error:- "AllowCustomPaging must be true and VirtualItemCount must be set for a DataGrid with ID MenuGrid when AllowPaging is set to true and the selected datasource does not implement ICollection"
0
2425
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: http://fredrik.nsquared2.com/viewpost.aspx?PostID=344&showfeedback=true The second page is a user control that contains a GridView control linked to a database table. What's supposed to happen is that the user clicks on a menu choice and an appropriate user control will load. For...
0
4749
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 through an objectdatasource. The paging on my GridView works fine except that when I change the page the FormView does not update. I tried setting the selectedindex to 0 in the GridView's PageIndexChanged event and manually binding the formview...
2
2613
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 reference not set to an instance of an object. I am attempting to access the controls in my PagerTemplate using the following code: CType(Me.fviewPhotoAlbum.FindControl("lnkPhotoAlbum"), LinkButton)
0
996
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" 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...
6
1844
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 controls. The first record from the DataSource is displayed, but not the Paging controls. I have tried doing it with both automatically generated Paging controls as well as using the PagerTemplate, but neither one is displayed. What is the problem?...
2
1940
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 particular order (like ProductID, Name, Description, Quantity etc.) are displayed in one DataGrid where as the personal details of the buyer corresponding to this order (like Name, E-Mail, Shipping & Billing Address etc.) are displayed in another...
1
1428
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 use paging formview ?!
0
1127
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 3.5 and Vista.) The first thing I notice is when I select an image on Photos.aspx, it appears to correctly display that photo on Details.aspx. However, the navigation buttons on Details.aspx do not work reliably. Sometimes they work, sometimes...
0
9672
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10437
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10214
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10164
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10001
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9042
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6780
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5437
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5563
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.