468,252 Members | 1,482 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,252 developers. It's quick & easy.

Gridview, using Callbacks when Sorting and Paging

For some reason when I enable the callback feature of the gridview I
still get a page refresh, that is it seems like there is a postback
that occurs, not a callback which is just supposed to update not the
whole page, but a portion of the page.

Strangely enough the URL below

http://beta.asp.net/QUICKSTARTV20/as.../gridview.aspx

(VB GridView Paging and Sorting Callbacks example)

has a callback example for gridview which explains that there should
NOT be a page refresh, but it sure seems like the page refreshes
(flickers) when I run the example.

Also another example I found on the web on msdn

http://msdn.microsoft.com/library/de...GrdDetView.asp
(Listing 4. Using Callbacks when Sorting and Paging section)

states that...

<snipp>
Client-Side Sorting and Paging
The GridView control provides you with the option of sorting and paging
records without requiring a form-post back to the Web server. In other
words, you can re-render the contents of a GridView when sorting and
paging, without needing to re-render the entire page.

You enable client paging and sorting by assigning the value true to the
EnableSortingAndPagingCallback property. When this property has the
value true, the GridView uses JavaScript to request an updated set of
records from the Web server.
<snipp>

I tried the piece of code that was provided...

<html>
<head runat="server">
<title>Callback GridView</title>
</head>
<body>
<form runat="server">

<%=DateTime.Now %>

<asp:GridView
DataSourceID="TitlesSource"
EnableSortingAndPagingCallbacks="true"
AllowPaging="true"
AllowSorting="true"
Runat="Server" />

<asp:SqlDataSource
ID="TitlesSource"
ConnectionString=
"Server=localhost;Database=pubs;Trusted_Connection =true"
SelectCommand="SELECT * FROM Titles"
Runat="Server" />
</form>
</body>
</html>

but even though sorting and paging callbacks are ENABLED, the TIME
which is NOT supposed to be updated, still gets updated everytime I do
a sort or change the page.

Does anyone have any idea why this is happening? Am I misunderstanding
the whole concept of callbacks? I made sure I am using the 2.0
framework and using ASP.NET 2.0, just because I installed Visual Studio
2005 on top of my existing Visual Studio 2003.

This sucks...I hope someone can shed some light for me into this.

Thanks for your time and help in advance.

Best Regards,

Tim :-)

Nov 19 '05 #1
1 7299
It's broken in the beta 2 bits and will be fixed in RTM.

-Brock
DevelopMentor
http://staff.develop.com/ballen
For some reason when I enable the callback feature of the gridview I
still get a page refresh, that is it seems like there is a postback
that occurs, not a callback which is just supposed to update not the
whole page, but a portion of the page.

Strangely enough the URL below

http://beta.asp.net/QUICKSTARTV20/as...a/gridview.asp
x

(VB GridView Paging and Sorting Callbacks example)

has a callback example for gridview which explains that there should
NOT be a page refresh, but it sure seems like the page refreshes
(flickers) when I run the example.

Also another example I found on the web on msdn

http://msdn.microsoft.com/library/de...ry/en-us/dnvs0
5/html/GrdDetView.asp (Listing 4. Using Callbacks when Sorting and
Paging section)

states that...

<snipp>
Client-Side Sorting and Paging
The GridView control provides you with the option of sorting and
paging
records without requiring a form-post back to the Web server. In other
words, you can re-render the contents of a GridView when sorting and
paging, without needing to re-render the entire page.
You enable client paging and sorting by assigning the value true to
the
EnableSortingAndPagingCallback property. When this property has the
value true, the GridView uses JavaScript to request an updated set of
records from the Web server.
<snipp>
I tried the piece of code that was provided...

<html>
<head runat="server">
<title>Callback GridView</title>
</head>
<body>
<form runat="server">
<%=DateTime.Now %>

<asp:GridView
DataSourceID="TitlesSource"
EnableSortingAndPagingCallbacks="true"
AllowPaging="true"
AllowSorting="true"
Runat="Server" />
<asp:SqlDataSource
ID="TitlesSource"
ConnectionString=
"Server=localhost;Database=pubs;Trusted_Connection =true"
SelectCommand="SELECT * FROM Titles"
Runat="Server" />
</form>
</body>
</html>

but even though sorting and paging callbacks are ENABLED, the TIME
which is NOT supposed to be updated, still gets updated everytime I do
a sort or change the page.

Does anyone have any idea why this is happening? Am I misunderstanding
the whole concept of callbacks? I made sure I am using the 2.0
framework and using ASP.NET 2.0, just because I installed Visual
Studio 2005 on top of my existing Visual Studio 2003.

This sucks...I hope someone can shed some light for me into this.

Thanks for your time and help in advance.

Best Regards,

Tim :-)


Nov 19 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

5 posts views Thread by yefei | last post: by
3 posts views Thread by mazdotnet | last post: by
1 post views Thread by davidjgonzalez | last post: by
3 posts views Thread by Marc Grutte | last post: by
reply views Thread by Don Miller | last post: by
4 posts views Thread by Don Miller | last post: by
3 posts views Thread by Toni | last post: by
1 post views Thread by John A Grandy | last post: by
reply views Thread by =?Utf-8?B?R3JlZw==?= | last post: by
reply views Thread by kermitthefrogpy | last post: by
reply views Thread by zattat | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.