我在做无刷新页面录入的时候,使用的updatepanel做无刷新处理,怎么有的快,有的很慢呀,我在vs2008里怎么知道很慢的到底执行了什么内容呀,我查了两天了也没有查出结果

解决方案 »

  1.   

    updatepanel有什么使用技巧呀,是不是需要设置呀
      

  2.   

    贴你那段引用UPDATEPANEL的代码出来吧!
      

  3.   

    <div id="panel_form"  style="border: thin outset #3366CC; display:none; width: 660px; height: 310px; background-color: #CCCCCC; " >
    <iframe style="z-index:-1; background-color: #808080; position: absolute;visibility:inherit;width:100%;height:100%;">
      </iframe>
       <asp:UpdatePanel ID="up20" runat="server">
    <ContentTemplate>
    <table border ="0" cellspacing="0"    style="background-color:#CCCCCC;width:100%;"      cellpadding="0">
    <tr  onmousedown="movetianyamessage(panel_form, event)" style="cursor:hand;height:26px; ">
    <td style="background-image:url('../bmp/fzlr_bt.gif')">
    <table border ="0" width="100%">
    <tr>
    <td align="left">&nbsp;<font color="#FFFFFF" style="font-weight: bolder">配件入库录入</font> 
    </td>
    <td></td>
    <td align="right" > <img alt="" src="../bmp/closebutton.gif" onclick="f_panel_hidden()" /></td>
    </tr>
    </table>
    </td>
    </tr>
    <tr>
    <td>
    <asp:FormView ID="FormView1" runat="server" Width="100%" AllowPaging="True" PagerSettings-Visible="False">
    <ItemTemplate>
     <table border="1" cellspacing="0"  cellpadding ="1" width="100%" align="center">
               <tr>
               <td colspan="4" align="center" style="background-color: #6699FF">配件入库登记</td></tr>
               <tr>
               <td> 配件编码 </td><td><asp:TextBox ID="hx_pjbm" text='<%# bind("pjbm")  %>' runat="server"></asp:TextBox><input id="Button4"  onclick="f_pos_hxpj()" type="button" value="..."  /></td>
               <td> 配件名称 </td>
               <td><asp:TextBox ID="hx_pjmc"   text='<%# bind("pjmc")  %>'  runat="server"></asp:TextBox><asp:TextBox ID="hx_pjid"  text='<%# bind("pjid")  %>'  style="display:none"  runat="server"></asp:TextBox></td>
               </tr>
               <tr>
               <td> 规格型号 </td><td><asp:TextBox ID="hx_ggxh"  text='<%# bind("ggxh")  %>'  runat="server"></asp:TextBox></td>
                <td> 配件类别 </td><td><asp:TextBox ID="tb_pjlb"  text='<%# bind("pjflmc")  %>' runat="server"></asp:TextBox></td>
                 </tr>
                 <tr>
               <td> 单位 </td><td><asp:TextBox ID="hx_jldw"  text='<%# bind("jldw")  %>'  runat="server"></asp:TextBox></td>
                <td>返厂标志</td><td><asp:TextBox ID="tb_fcbz"  text='<%# bind("fcbz")  %>' runat="server"></asp:TextBox></td>
               </tr>
               
               <tr>
               <td> 数量 </td><td><asp:TextBox ID="hx_sl"   text='<%# bind("rksl")  %>'  runat="server"></asp:TextBox></td>
                <td> 条形码 </td><td><asp:TextBox ID="tb_txm"  text='<%# bind("txm")  %>' runat="server"></asp:TextBox></td>
                </tr>
                <tr>
               <td> 单价 </td><td><asp:TextBox ID="hx_dj"  text='<%# bind("ghdj")  %>'  runat="server"></asp:TextBox></td>
                <td> 配件图片 </td><td><asp:label ID="tb_pjtp"  text='<%# iif(request("addedit")="ADD",DataBinder.Eval(Container.DataItem, "tp").ToString(),f_tppath(DataBinder.Eval(Container.DataItem, "tp").ToString()))  %>' runat="server" ></asp:label></td>
               </tr>
               <tr>
               <td> 金额 </td><td><asp:TextBox ID="hx_je"  text='<%# bind("ghje")  %>'  runat="server"></asp:TextBox><asp:TextBox  ID="tb_id" runat="server" text='<%# bind("id")  %>' style="display:none"></asp:TextBox> </td>
                <td> 备注 </td><td><asp:TextBox ID="tb_beizhu_pj"  text='<%# bind("beizhu_pj")  %>' runat="server"></asp:TextBox></td>
               </tr>
              
               </table>
    </ItemTemplate>
    <EditItemTemplate>
      <table border="1" cellspacing="0"  cellpadding ="1" width="100%" align="center">
               <tr>
               <td colspan="4" align="center" style="background-color: #6699FF">配件入库登记</td></tr>
               <tr>
               <td> 配件编码 </td><td><asp:TextBox ID="hx_pjbm" text='<%# bind("pjbm")  %>' runat="server"></asp:TextBox><input id="Button4"  onclick="f_pos_hxpj()" type="button" value="..."  /></td>
               <td> 配件名称 </td>
               <td><asp:TextBox ID="hx_pjmc"   text='<%# bind("pjmc")  %>'  runat="server"></asp:TextBox><asp:TextBox ID="hx_pjid"  text='<%# bind("pjid")  %>'  style="display:none"  runat="server"></asp:TextBox></td>
               </tr>
               <tr>
               <td> 规格型号 </td><td><asp:TextBox ID="hx_ggxh"  text='<%# bind("ggxh")  %>'  runat="server"></asp:TextBox></td>
                <td> 配件类别 </td><td><asp:TextBox ID="tb_pjlb"  text='<%# bind("pjflmc")  %>' runat="server"></asp:TextBox></td>
                 </tr>
                 <tr>
               <td> 单位 </td><td><asp:TextBox ID="hx_jldw"  text='<%# bind("jldw")  %>'  runat="server"></asp:TextBox></td>
                <td>返厂标志</td><td><asp:TextBox ID="tb_fcbz"  text='<%# bind("fcbz")  %>' runat="server"></asp:TextBox></td>
               </tr>
               
               <tr>
               <td> 入库数量 </td><td><asp:TextBox ID="hx_sl"   text='<%# bind("rksl")  %>'  runat="server"></asp:TextBox></td>
                <td> 条形码 </td><td><asp:TextBox ID="tb_txm"  text='<%# bind("txm")  %>' runat="server"></asp:TextBox></td>
                </tr>
                <tr>
               <td> 单价 </td><td><asp:TextBox ID="hx_dj"  text='<%# bind("ghdj")  %>'  runat="server"></asp:TextBox></td>
                <td> 配件图片 </td><td><asp:label ID="tb_pjtp"  text='<%# iif(request("addedit")="ADD",DataBinder.Eval(Container.DataItem, "tp").ToString(),f_tppath(DataBinder.Eval(Container.DataItem, "tp").ToString()))  %>' runat="server" ></asp:label></td>
               </tr>
               <tr>
               <td> 金额 </td><td><asp:TextBox ID="hx_je"  text='<%# bind("ghje")  %>'  runat="server"></asp:TextBox><asp:TextBox  ID="tb_id" runat="server" text='<%# bind("id")  %>' style="display:none"></asp:TextBox> </td>
                <td> 备注 </td><td><asp:TextBox ID="tb_beizhu_pj"  text='<%# bind("beizhu_pj")  %>' runat="server"></asp:TextBox></td>
               </tr>
              
               <tr>
               <td  colspan="4" align="center" style="height :100px">
                       <asp:Button ID="EditButton"
                                            Text="更新记录"
                                            CommandName="Update" 
                                            RunAt="server"/>
                                             &nbsp;
                            <asp:Button ID="NewButton" 
                                            Text="添加记录"
                                            CommandName="New"
                                            RunAt="server"/>            
                            &nbsp; <asp:Button ID="DeleteButton" 
                                            Text="删除记录"
                                            CommandName="Delete"
                                            RunAt="server"/>  &nbsp;
                                            <asp:button id="PreviousButton"
                      text="上一行"
                      commandname="Page"
                      commandargument="Prev"
                      runat="Server"/>
                    <asp:button id="NextButton"
                      text="下一行"
                      commandname="Page"
                      commandargument="Next"
                      runat="Server"/>  &nbsp;
                    <input id="Button1" type="button" value="退出"    onclick="f_panel_hidden()"/> 
      
                                  
               </td>
               </tr>
                
            
               </table>
    </EditItemTemplate>                          
      

  4.   

          <InsertItemTemplate>
               <table border="1" cellspacing="0"  cellpadding ="1" width="100%" align="center">
               <tr>
               <td colspan="4" align="center" style="background-color: #6699FF">配件入库登记</td></tr>
               <tr>
               <td> 配件编码 </td>
               <td><asp:TextBox ID="hx_pjbm" runat="server"></asp:TextBox><input id="Button4"  onclick="f_pos_hxpj()" type="button" value="..."  /></td>
               <td> 配件名称 </td><td><asp:TextBox ID="hx_pjmc" runat="server"></asp:TextBox><asp:TextBox ID="hx_pjid"  style="display:none"  runat="server"></asp:TextBox></td>
               </tr>
               <tr>
               <td> 规格型号 </td><td><asp:TextBox ID="hx_ggxh" runat="server"></asp:TextBox></td>
                <td> 配件类别 </td><td><asp:TextBox ID="tb_pjlb" runat="server"></asp:TextBox></td>
                 </tr>
                 <tr>
               <td> 单位 </td><td><asp:TextBox ID="hx_jldw" runat="server"></asp:TextBox></td>
               <td>返厂标志</td><td><asp:TextBox ID="tb_fcbz" runat="server"></asp:TextBox></td>
               </tr>
               <tr>           
               <td> 入库数量 </td><td><asp:TextBox ID="hx_sl" runat="server"></asp:TextBox></td>
                <td> 条形码 </td><td><asp:TextBox ID="tb_txm" runat="server"></asp:TextBox></td>
                </tr>
                <tr>
               <td> 单价 </td><td><asp:TextBox ID="hx_dj" runat="server"></asp:TextBox></td>
                <td> 配件图片 </td><td><asp:label ID="tb_pjtp" runat="server" ></asp:label></td>
               </tr>
               <tr>
               <td> 金额 </td><td ><asp:TextBox ID="hx_je" runat="server"></asp:TextBox><asp:TextBox  ID="tb_id" runat="server" style="display:none"></asp:TextBox>   </td>
               <td> 备注 </td><td><asp:TextBox ID="tb_beizhu_pj" runat="server"></asp:TextBox></td>
               </tr>
               
               <tr>
               <td colspan="4" align="center" style="height :100px">
              
                <asp:Button ID="InsertButton"
                                            Text="添加记录"
                                            CommandName="Insert"   runat="server"/>
                           
                                             &nbsp;
                                             <asp:button id="PreviousButton"
                      text="上一行"
                      commandname="Page"
                      commandargument="Prev"
                      runat="Server"/>
                    <asp:button id="NextButton"
                      text="下一行"
                      commandname="Page"
                      commandargument="Next"
                      runat="Server"/>  &nbsp;
                   <input id="Button1" type="button" value="退出"    onclick="f_panel_hidden()"/> 
               
               </td>
               </tr>
              
               </table>
               </InsertItemTemplate>    
                   </asp:FormView>
     </td>
        </tr> 
        <tr>
        <td align="right">  <asp:Label ID="lab_page" runat="server"></asp:Label></td>
        </tr>   
    </table>
    </ContentTemplate>
    </asp:UpdatePanel>
    </div>
      

  5.   

    在 formview1外边有一个updatepanel
      

  6.   

    慢是你的样式问题吧,style尽量少用,用class还有你用了背景图片肯定会慢的,你可以把背景图片该成颜色或很小的图片。
      

  7.   

    你用的table布局也会有影响。
      

  8.   

    哦,不用table进行定位,用什么进行定位呀
      

  9.   

    大量使用updatePanel  就会导致网页开启与刷新缓慢的问题。