I am having a listview with the following code:-

```
 <asp:ListView ID="ListView1" runat="server" 
        onitemcommand="ListView1_ItemCommand" 
        onitemdatabound="ListView1_ItemDataBound"
        DataKeyNames="Question_Id" onitemdeleting="ListView1_ItemDeleting" 
        onitemediting="ListView1_ItemEditing" 
            onpagepropertieschanging="ListView1_PagePropertiesChanging" 
            >

    <ItemTemplate>
    <ul>
    <li> <%# Eval("Questiontitle") %> 
     <%# Eval("Mainquestion")%> 

        <asp:LinkButton ID="LinkButton1" runat="server" CommandName="approve" CommandArgument='<%# Eval("Question_Id") %>'>Approve</asp:LinkButton> 

        <asp:LinkButton ID="LinkButton2" runat="server" CommandName="deny" CommandArgument='<%# Eval("Question_Id") %>'>Deny</asp:LinkButton> </li>
    </ul>
    </ItemTemplate>
    <EmptyDataTemplate>
            <br />No data found
    </EmptyDataTemplate>
    <LayoutTemplate>
        <div ID="itemPlaceholderContainer" runat="server" style="font-family: Verdana, Arial, Helvetica, sans-serif;">
        <span ID="itemPlaceholder" runat="server" />
        </div>
        <div style="text-align: center;background-color: #CCCCCC;font-family: Verdana,      Arial, Helvetica, sans-serif;color: #000000;">
        </div>    
        <asp:DataPager ID="dpListView" runat="server" PageSize="2" OnPreRender="ListView1_PreRender">
            <Fields>
                <asp:NumericPagerField ButtonType="Link"/>
            </Fields>
        </asp:DataPager>        
     </LayoutTemplate>
    </asp:ListView>

```

Now my cs code is given as

```
var cat = DropDownList1.SelectedValue;
        var DBL = Getdata.GetDataFromSP("Spgetquestionbycategoryid", new object[,] { { "cat" }, { cat } });
        if (DBL.Rows[e.Item.DataItemIndex]["Approval"].ToString() == "True")
        {
            LinkButton btn = ListView1.Controls[e.Item.DataItemIndex].FindControl("LinkButton1") as LinkButton;
            LinkButton btn1 = ListView1.Controls[e.Item.DataItemIndex].FindControl("LinkButton2") as LinkButton;
            btn.BackColor = System.Drawing.Color.Green;
            btn1.BackColor = System.Drawing.Color.Transparent;
        }
        else if (DBL.Rows[e.Item.DataItemIndex]["Approval"].ToString() == "")
        {
            LinkButton btn = ListView1.Controls[e.Item.DataItemIndex].FindControl("LinkButton2") as LinkButton;
            LinkButton btn1 = ListView1.Controls[e.Item.DataItemIndex].FindControl("LinkButton1") as LinkButton;
            btn.BackColor = System.Drawing.Color.Transparent;
            btn1.BackColor = System.Drawing.Color.Transparent;
        }
        else if (DBL.Rows[e.Item.DataItemIndex]["Approval"].ToString() == "False")
        {
            LinkButton btn = ListView1.Controls[e.Item.DataItemIndex].FindControl("LinkButton2") as LinkButton;
            LinkButton btn1 = ListView1.Controls[e.Item.DataItemIndex].FindControl("LinkButton1") as LinkButton;
            btn.BackColor = System.Drawing.Color.Red;
            btn1.BackColor = System.Drawing.Color.Transparent;
        }

```

Now at this place when i try to find out my linkbutton it is giving me null object reference error.
As i have some conditions that are to be applied to the link button.

If i remove the datapaging from the same.I dont get any error and it is working perfectly.
please suggest.