c# - Is using ObjectDataSource a good practice? -
in company few of employees using objectdatasource. example snippet :
<asp:objectdatasource id="odsrequirement" runat="server" enablepaging="true" maximumrowsparametername="intmaxrows" selectmethod="getall" startrowindexparametername="introwindex" typename="mynamespace.mytype" sortparametername="sortstring" onselecting="odsrequirement_selecting" selectcountmethod="getallcount"> <selectparameters> <asp:parameter name="a" defaultvalue="null" /> <asp:parameter name="b" defaultvalue="null" /> <asp:parameter name="c" /> <asp:parameter name="d" /> <asp:parameter name="e" /> </selectparameters> </asp:objectdatasource>
will selectcountmethod getallcount fired after selectmethod getall? , there better way should doing this?
thanks in advance:)
personally i'm not big fan of these types of controls. prefer getting data code-behind , binding data page. problem you're baking domain logic aspx page itself. i'd recommend seperating moving code gets data class, should in layer (i.e. domain, or model - class libraries).
regardless, try away using control , move data gathering logic file. in long term, see benefits.
http://geekswithblogs.net/opiesblog/archive/2006/09/11/90906.aspx
Comments
Post a Comment