Hi,
Given an ObjectDataSourc e and GridView declared as:
<asp:ObjectData Source runat="server" ID="FullCategor yList"
TypeName="AD.Ap p_Code.Category DataMapper"
SelectMethod="G etCategories" SortParameterNa me="SortExpress ion"
DataObjectTypeN ame="AD.App_Cod e.Category"
UpdateMethod="U pdateCategory"> </asp:ObjectDataS ource>
<asp:GridView ID="Categories " runat="server"
DataSourceID="F ullCategoryList " AutoGenerateCol umns="False"
AllowPaging="Tr ue" AllowSorting="T rue"
EnableSortingAn dPagingCallback s="False"
EnableViewState ="False">
<Columns>
<asp:BoundFie ld DataField="Cate goryID" HeaderText="Cat egoryID"
SortExpression= "CategoryID " />
<asp:BoundFie ld DataField="Cate goryName"
HeaderText="Cat egoryName" SortExpression= "CategoryNa me" />
<asp:BoundFie ld DataField="Desc ription" HeaderText="Des cription"
SortExpression= "Descriptio n" />
<asp:CommandFie ld ShowEditButton= "True" />
</Columns>
</asp:GridView>
I have a method in CategoryDataMap per called UpdateCategory, the method call
works correctly, what I'd like to know is if UpdateCategory throws an
exception where can I catch it to display an error to the user as to why the
details were not updated.
TIA
MattC
Given an ObjectDataSourc e and GridView declared as:
<asp:ObjectData Source runat="server" ID="FullCategor yList"
TypeName="AD.Ap p_Code.Category DataMapper"
SelectMethod="G etCategories" SortParameterNa me="SortExpress ion"
DataObjectTypeN ame="AD.App_Cod e.Category"
UpdateMethod="U pdateCategory"> </asp:ObjectDataS ource>
<asp:GridView ID="Categories " runat="server"
DataSourceID="F ullCategoryList " AutoGenerateCol umns="False"
AllowPaging="Tr ue" AllowSorting="T rue"
EnableSortingAn dPagingCallback s="False"
EnableViewState ="False">
<Columns>
<asp:BoundFie ld DataField="Cate goryID" HeaderText="Cat egoryID"
SortExpression= "CategoryID " />
<asp:BoundFie ld DataField="Cate goryName"
HeaderText="Cat egoryName" SortExpression= "CategoryNa me" />
<asp:BoundFie ld DataField="Desc ription" HeaderText="Des cription"
SortExpression= "Descriptio n" />
<asp:CommandFie ld ShowEditButton= "True" />
</Columns>
</asp:GridView>
I have a method in CategoryDataMap per called UpdateCategory, the method call
works correctly, what I'd like to know is if UpdateCategory throws an
exception where can I catch it to display an error to the user as to why the
details were not updated.
TIA
MattC
Comment