Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 4 > BOOK: Beginning ASP.NET 4 : in C# and VB
|
BOOK: Beginning ASP.NET 4 : in C# and VB
This is the forum to discuss the Wrox book Beginning ASP.NET 4: in C# and VB by Imar Spaanjaars; ISBN: 9780470502211
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning ASP.NET 4 : in C# and VB section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old November 19th, 2012, 03:34 PM
Friend of Wrox
 
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
Default p. 525 - First, Previous, Next, & Last buttons overlaping

Imar,

I'm not sure what I'm doing wrong, but I am not able to get these buttons to be positioned in the right place.

The buttons keep on overlapping the picture descriptions.

Here is the source for default.aspx...

Code:
<%@ Page Title="All Photo Albums" Language="C#" MasterPageFile="~/MasterPages/FrontEnd.master" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="PhotoAlbums_Default" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" Runat="Server">
</asp:Content>


<asp:Content ID="Content2" ContentPlaceHolderID="cpMainContent" Runat="Server">
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <ContentTemplate>
            <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
                DataSourceID="EntityDataSource1" DataTextField="Name" DataValueField="Id">
            </asp:DropDownList>

            <asp:ListView ID="ListView1" runat="server" DataKeyNames="Id" DataSourceID="EntityDataSource2">
                
                <EmptyDataTemplate>
                    No data was returned.
                </EmptyDataTemplate>
                
                <ItemTemplate>
                    <li>                                                
                        <%-- Did not use ImageUrl prop of Hyperlink control since we wanted to display a tooltip --%>
                        <asp:HyperLink ID="HyperLink2" runat="server" 
                             NavigateUrl='<%# "~/PhotoAlbums/PictureDetails.aspx?PictureId=" + Eval("Id").ToString()  %>' > <asp:Image ID="Image1" runat="server" ImageUrl='<%# Eval("ImageUrl") %>' ToolTip='<%# Eval("ToolTip") %>' />
                        </asp:HyperLink>                        
                        <asp:Label ID="DescriptionLabel" runat="server" Text='<%# Eval("Description") %>' />                                                                                             
                    </li>
                </ItemTemplate>        

                <LayoutTemplate>
                    <ul class="ItemContainer">
                        <li runat="server" id="itemPlaceholder" />
                    </ul>
                    <div style="clear: both;">
                        <asp:DataPager ID="DataPager1" runat="server" PageSize="3">
                            <Fields>
                                <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                    ShowLastPageButton="True" />
                            </Fields>
                        </asp:DataPager>
                    </div>
                </LayoutTemplate>
        
                </asp:ListView>
    
            <asp:EntityDataSource ID="EntityDataSource2" runat="server" 
                AutoGenerateWhereClause="True" ConnectionString="name=PlanetWroxEntities" 
                DefaultContainerName="PlanetWroxEntities" EnableFlattening="False" 
                EntitySetName="Pictures" EntityTypeFilter="" Select="" Where="">
                <WhereParameters>
                    <asp:ControlParameter ControlID="DropDownList1" Name="PhotoAlbumId" 
                        PropertyName="SelectedValue" Type="Int32" />
                </WhereParameters>
        
            </asp:EntityDataSource>

            <asp:EntityDataSource ID="EntityDataSource1" runat="server" 
                ConnectionString="name=PlanetWroxEntities" 
                DefaultContainerName="PlanetWroxEntities" EnableFlattening="False" 
                EntitySetName="PhotoAlbums" Select="it.[Id], it.[Name]">
            </asp:EntityDataSource>
        </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="cpClientScript" Runat="Server">
</asp:Content>
Thank you.

Tulsi
 
Old November 20th, 2012, 03:32 AM
Imar's Avatar
Wrox Author
 
Join Date: Jun 2003
Posts: 17,089
Thanks: 80
Thanked 1,576 Times in 1,552 Posts
Default

Hi there,

Hard to say without seeing the actual page and other CSS code. Did you try the sample from the book? Did those work for you?

And have you tried adding a <br /> between the <ul> and the <div> with the buttons?

Imar
__________________
Imar Spaanjaars
http://Imar.Spaanjaars.Com
Follow me on Twitter

Author of Beginning ASP.NET 4.5 : in C# and VB, Beginning ASP.NET Web Pages with WebMatrix
and Beginning ASP.NET 4 : in C# and VB.
Did this post help you? Click the button below this post to show your appreciation!
 
Old December 10th, 2012, 03:01 PM
Friend of Wrox
 
Join Date: Mar 2011
Posts: 126
Thanks: 39
Thanked 2 Times in 2 Posts
Default

Hi Imar,

Thank you for the suggestions. I tried the sample from the book, but it also did not work.

I had to add the <br /> between the <ul> and the <div> with the buttons in the original source. After doing this, it did work.

Thanks.

Tulsi
The Following User Says Thank You to Tulsi For This Useful Post:
Imar (December 11th, 2012)





Similar Threads
Thread Thread Starter Forum Replies Last Post
Next and Previous buttons. g_vamsi_krish ASP.NET 1.x and 2.0 Application Design 1 January 19th, 2006 11:19 AM
previous column & next column ct Excel VBA 4 August 19th, 2005 04:50 AM
Page 1-2-3-4 etc.... Next and Previous buttons crmpicco Classic ASP Basics 1 March 18th, 2005 12:00 PM
userform minimise & maximise buttons kev Excel VBA 1 December 7th, 2004 04:45 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.