Showing posts with label sample. Show all posts
Showing posts with label sample. Show all posts

Wednesday, March 28, 2012

pagemethod call code sample

Can anyont point me to a code sample where a call is made to a server page method from the client script code?

thanks!

Pratibha

Hi,

please checkthis post from my blog.

Saturday, March 24, 2012

Paging Sample

Hi there. Here there is an absolute newbie to Ajax. I'm looking for an Ajax sample for gridview/datagrid paging. Where can i find a -closed- sample?

Thanks in advance.

There is no difference to implement asp:GridView paging?between?asp.net?2.0?and?Ajax.Here?are?some?sample?codes?for?your?reference.
<div>
<asp:UpdatePanel ID="pnlGuestbook" runat="server">
<ContentTemplate>
<asp:GridView ID="gvGuestBook" Width="250" CssClass="NotifyTable" DataSourceID="SqlDataSource2" PageSize="2" AllowPaging="True" runat="server" AutoGenerateColumns="False" DataKeyNames="Message_ID">
<Columns>
<asp:TemplateField>
<ItemTemplate>
<table>
<tr>
<td><br />
<%#Eval("Subject")%>
</td>
</tr>
</table>
</ItemTemplate>
</asp:TemplateField>
<asp:CommandField ButtonType="Button" >
<ItemStyle VerticalAlign="Top" />
</asp:CommandField>
</Columns>
<PagerSettings Mode="NumericFirstLast" FirstPageText="First" NextPageText="Next" LastPageText="Last" />
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:ProductConnectionString %>"
SelectCommand="SELECT [Message_ID], [From], [Subject], [DateSent] FROM [Message]">
</asp:SqlDataSource>
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="gvGuestBook" EventName="PageIndexChanged"></asp:AsyncPostBackTrigger>
</Triggers>
</asp:UpdatePanel>
</div>
Wish this can help you.
Thank you. It was so simple. Just drag and drop two controls (ScriptManager and UpdatePanel) and put GridView in UpdatePanel. Love it. =)