GridView Paging + Atlas

S

Slavan

Hello everyone,
I have a gridView on my page that I bind to a dataTable in my code
behind. I know that when I do that I need to implement
pageIndexChanging event for paging functionality to work. I did that
and it works fine. But, the problem is that I use atlas control
updatePanel on my page, when I place gridView in that control, paging
stops working. It does not throw any exceptions. But there is a small
icon in the status bar that there are errors on the page. If anyone
knows what is the problem and how to fix it, I would really appreciate
it.
 
A

Alvin Bruney [MVP]

Is your method even getting called, put an alert box in the method call to
see if it is getting fired, something like
Response.Write("<script>alert('fired')</script>"); or the equivalent.

--
________________________
Warm regards,
Alvin Bruney [MVP ASP.NET]

[Shameless Author plug]
Professional VSTO.NET - Wrox/Wiley
The O.W.C. Black Book with .NET
www.lulu.com/owc, Amazon
Blog: http://www.msmvps.com/blogs/alvin
 
S

Slavan

<%@ Page Language="C#" AutoEventWireup="true"
CodeFile="searchTest.aspx.cs" Inherits="searchTest" %>

<!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" id="head1">
</head>
<body>
<form id="form1" runat="server">

<atlas:ScriptManager ID="ScriptManager1" runat="server"
EnablePartialRendering="true" />

<atlas:UpdatePanel runat="server" ID="panel1" Mode="Always"
RenderMode="inline">
<ContentTemplate>


<div id="mainContent">

<asp:Button ID="btnSearch" runat="server" Text="Search"
OnClick="btnSearch_Click" />
<center>
<asp:GridView ID="grdSearch" runat="server"
AllowPaging="true" PageSize="3" AutoGenerateColumns="true"
OnPageIndexChanging="grdSearch_PageIndexChanging" >

</asp:GridView>
</center>
</div>
</ContentTemplate>
</atlas:UpdatePanel>

</form>
</body>
</html>





using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class searchTest : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{

}
protected void btnSearch_Click(object sender, EventArgs e)
{
// getReasons() returns DataTable with two columns
grdSearch.DataSource = generelDAL.getReasons();
grdSearch.DataBind();
}

protected void grdSearch_PageIndexChanging(object sender,
GridViewPageEventArgs e)
{
grdSearch.PageIndex = e.NewPageIndex;
grdSearch.DataSource = generelDAL.getReasons();
grdSearch.DataBind();
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,770
Messages
2,569,584
Members
45,075
Latest member
MakersCBDBloodSupport

Latest Threads

Top