Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

Problems with datapager listview and loginview

Avatar of mrnmnew
mrnmnew asked on
.NET ProgrammingASP.NETVisual Basic.NET
8 Comments1 Solution689 ViewsLast Modified:
I am trying to show a list of records from a database using the LIstView Control. The items displaied will depend on if the user is logged in or not. I am using the datapager to allow the user to step through the items 10 at a time. The first Page displays fine but subsquent pages show no data from the database although still show that the records are there just no data. I have no idea what is going on except probably a bug in the Microsoft controls. Does anyone have any ideas on this? I have been struggling with this for 5 days now.
Answers in VB please.

There is no code behind:

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="trial.aspx.vb" Inherits="trial"
    Trace="false" %>

<!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">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:LoginName ID="LoginName1" runat="server" />
        <asp:LoginStatus ID="LoginStatus1" runat="server" />
        <asp:SqlDataSource ID="SqlDataSourceFull" runat="server" ConnectionString="<%$ ConnectionStrings:MTConnectionString %>"
            SelectCommand="SELECT [Title], [id] FROM [Articles] "></asp:SqlDataSource>
        <asp:Login ID="Login1" runat="server">
        </asp:Login>
        <asp:Button ID="ButtonFull" runat="server" Text="Full" UseSubmitBehavior="True" />
        <asp:ListView ID="ListView1" runat="server" DataKeyNames="id" DataSourceID="SqlDataSourceFull">
            <ItemTemplate>
                <tr>
                    <td>
                        <asp:LoginView ID="LoginView2" runat="server">
                            <AnonymousTemplate>
                                Some text
                                <asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("id") %>'></asp:Label>
                            </AnonymousTemplate>
                            <LoggedInTemplate>
                                Some text
                                <asp:Label ID="Label1" runat="server" Text='<%# Eval("id") %>'></asp:Label>
                                <asp:Label ID="TitleLabel" runat="server" Text='<%# Eval("Title") %>'></asp:Label>
                            </LoggedInTemplate>
                        </asp:LoginView>
                    </td>
                </tr>
            </ItemTemplate>
            <SelectedItemTemplate>
            </SelectedItemTemplate>
            <EmptyDataTemplate>
                <br />
                No data was returned.
            </EmptyDataTemplate>
            <LayoutTemplate>
                <table id="itemPlaceholderContainer" runat="server" border="0" style="">
                    <tr id="itemPlaceholder" runat="server">
                    </tr>
                </table>
            </LayoutTemplate>
        </asp:ListView>
        <asp:DataPager ID="DataPager1" runat="server" PagedControlID="ListView1">
            <Fields>
                <asp:NextPreviousPagerField />
            </Fields>
        </asp:DataPager>
    </div>
    </form>
</body>
</html>
ASKER CERTIFIED SOLUTION
Avatar of mrnmnew
mrnmnew

Our community of experts have been thoroughly vetted for their expertise and industry experience.

Commented:
This problem has been solved!
Unlock 1 Answer and 8 Comments.
See Answers