locked
How can i avoid large number of round trips to the server calls using inline functions ? RRS feed

  • Question

  • User1253338400 posted

    I have a Grid with a number of columns but in one particular column i use the following 

    <asp:GridView ID="GridView2" runat="server" AutoGenerateColumns="False" DataSourceID="SqlDataSource1">

            <Columns>

                <asp:BoundField DataField="Name" HeaderText="Name" SortExpression="Name" />

                <asp:TemplateField>

                    <ItemTemplate>

                        <asp:Image ID="Image2" runat="server" ImageUrl='<%# ImageLink(
                                                                        DataBinder.Eval(Container.DataItem, "DocNo"), DataBinder.Eval(Container.DataItem, "DocLineNo"),
                                                                        DataBinder.Eval(Container.DataItem, "Value"),
                                                                        DataBinder.Eval(Container.DataItem, "ImageId"))%>'>' Width="70" />

                    </ItemTemplate>

                </asp:TemplateField>

            </Columns>

        </asp:GridView>


    Now each line has a different image and if I have lets say 1000 rows to be rendered on the grid then this call is made 1000 times .

    Is there a way I can use inline functions and avoid this much round trips to the server  or is there a better way of doing this ?

    Thanks 

    Thursday, January 19, 2017 8:21 AM

Answers

All replies