none
求助!谁能给我的页面进行一下优化提高一下页面打开速度 RRS feed

  • 问题

  • <img id="bigpic" src="" style="width: 150px; height: 150px; position: absolute; top: 50%;
            left: 50%; margin-top: -75px; margin-left: -75px; border: 1px solid #0000FF;
            display: none;" />
        <div>
            <asp:AccessDataSource ID="AccessDataSource1" runat="server" DataFile="~/App_Data/suowei.mdb"
                SelectCommand="SELECT * FROM [goodstype] WHERE ([p_id] = ?) ORDER BY [px]" EnableCaching="True">
                <SelectParameters>
                    <asp:QueryStringParameter Name="p_id" QueryStringField="type" Type="Int32" />
                </SelectParameters>
            </asp:AccessDataSource>
            <asp:DataList ID="DataList1" runat="server" DataKeyField="ID" DataSourceID="AccessDataSource1"
                Width="1000px">
                <ItemStyle BorderColor="#CCCCCC" BorderStyle="Solid" BorderWidth="1px" CssClass="dlrow"
                    Width="50%" />
                <ItemTemplate>
                    <div class="dltitle">
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("names") %>'></asp:Label>
                        <asp:Label ID="Label2" runat="server" Text='<%# Eval("ID") %>' Visible="false"></asp:Label>
                    </div>
                    <div class="goodslist_title_ear">
                        <div class="e_l">
                            <div class="goodsinf_filter" style="width: 100px; margin-left: 5px;">
                                名称(型号)</div>
                            <div class="goodsinf_filter" style="width: 180px; text-align: center;">
                                参数</div>
                            <div class="goodsinf_filter" style="width: 60px; text-align: center;">
                                价格</div>
                            <div class="goodsinf_filter" style="width: 80px; text-align: center;">
                                状态</div>
                        </div>
                        <div class="e_r">
                            <div class="goodsinf_filter" style="width: 100px; margin-left: 5px;">
                                名称(型号)</div>
                            <div class="goodsinf_filter" style="width: 180px; text-align: center;">
                                参数</div>
                            <div class="goodsinf_filter" style="width: 60px; text-align: center;">
                                价格</div>
                            <div class="goodsinf_filter" style="width: 80px; text-align: center;">
                                状态</div>
                        </div>
                    </div>
                    <div>
                        <asp:AccessDataSource ID="AccessDataSource2" runat="server" DataFile="~/App_Data/suowei.mdb"
                            SelectCommand="SELECT * FROM [goods] WHERE ([goodstype] = ?)" CacheExpirationPolicy="Sliding"
                            EnableCaching="True">
                            <SelectParameters>
                                <asp:ControlParameter ControlID="Label2" Name="goodstype" PropertyName="Text" Type="Int32" />
                            </SelectParameters>
                        </asp:AccessDataSource>
                        <asp:DataList ID="DataList2" runat="server" DataKeyField="ID" DataSourceID="AccessDataSource2"
                            RepeatColumns="2" RepeatDirection="Horizontal" Width="1000px" CssClass="DL2">
                            <ItemStyle CssClass="goodsinf_row" Width="50%" Height="33px" VerticalAlign="Middle" />
                            <ItemTemplate>
                                <div class="goodsinf_filter" style="width: 30px; margin-left: 5px;">
                                    <img src='<%# eval("images") %>' class="epic" alt="移动显示大图" style="width: 30px; height: 30px;" />
                                </div>
                                <div class="goodsinf_filter" style="width: 100px;">
                                    <asp:Label ID="namesLabel" runat="server" Text='<%# Eval("names") %>' />
                                </div>
                                <div class="goodsinf_filter" style="width: 158px; overflow: hidden">
                                    <asp:Label ID="infLabel" runat="server" Text='<%# Eval("inf") %>' />
                                </div>
                                <div class="goodsinf_filter" style="width: 60px">
                                    ¥<asp:Label ID="C_priceLabel0" runat="server" Text='<%# Eval("M_price") %>' />
                                </div>
                                <div class="goodsinf_filter" style="width: 80px">
                                    <%# rpnum(Eval("zt"))%>
                                </div>
                                <div class="goodsinf_filter" style="width: 40px; cursor: pointer;" goodsname='<%# Eval("names") %>'
                                    goodsmoney='<%# Eval("M_price") %>' goodsid='<%# eval("id") %>'>
                                    订购
                                </div>
                            </ItemTemplate>
                        </asp:DataList>
                    </div>
                </ItemTemplate>
            </asp:DataList>
            <div id="hiddiv">
                <div id="_ear">
                </div>
                <div id="box">
                    <div id="title">
                        消息</div>
                    <div class="row">
                        产品名:<a id="name"></a> 产品单价:<a id="money"></a><a id="goodsid" style="display: none"></a></div>
                    <div class="row">
                        &nbsp;订购数量:<input id="Text1" class="text" type="text" value="0" /></div>
                    <div class="row">
                        总金额:<a id="allmoneys"></a>元</div>
                    <div class="row" style="text-align: center;">
                        <input id="Button1" class="text" type="button" value="确定" />
                        <input id="Button2" class="text" type="button" value="取消" /></div>
                </div>
            </div>
        </div>
        </form>
    </body>

    这段代码随数理的增加会越来越慢,我的认为是衔套有数据源控件,谁能给优化一下,提高一下显示速度,现在两个栏目,共100第信息就要等30秒

    提前谢谢!


    冯启昌
    2011年7月26日 22:56

答案