日期:2014-05-18  浏览次数:20433 次

gridvied菜鸟问题,在线等!解决立刻给分!
<asp:ObjectDataSource   ID= "odsArticleItem "   TypeName= "Logic.Article "   SelectMethod= "A_Select "     runat= "server ">
</asp:ObjectDataSource>
<asp:GridView   ID= "gvArticleItme "   PageSize= "8 "   Caption= "文章列表 "     AllowPaging= "True "   AllowSorting= "true "     DataKeyNames= "Article_Id "   runat= "server "   AutoGenerateColumns= "False ">
<Columns>
<asp:HyperLinkField   DataTextField= "Article_Title "   DataNavigateUrlFields= "Article_Id "   DataNavigateUrlFormatString= "A_Update.aspx?id={0} "     Target= "_blank "   HeaderText= "标题 "   />
<asp:BoundField   DataField= "Article_Time "   DataFormatString= "[{0}] "   HeaderText= "发表时间 "   />                                                                                
<asp:ButtonField   ButtonType= "Button "     CommandName= "Delete "   HeaderText= "删除 "   ShowHeader= "True "Text= "删除 "   />
</Columns>
</asp:GridView>

---------------------------
----------------------------

上面是代码,我的   GridView   当点击分页时,提示错误信息:
---异常详细信息:   System.Web.HttpException:   GridView“gvArticleItme”激发了未处理的事件“PageIndexChanging”。----

我用的是默认分页,怎么要自已处理PageIndexChanging呢?请问怎么解决?
另外我的这个:
<asp:ButtonField   ButtonType= "Button "     CommandName= "Delete "   HeaderText= "删除 "   ShowHeader= "True "Text= "删除 "   />
它的事件处理应当怎么写呢?

如果有   GridView   自定义分页的示例代码请放些出来参巧,感激不尽!



------解决方案--------------------
在后台直接写对应的PageIndexChanged事件啊.
删除就直接写对应的OnRowDeleted的事件.

注意postback