| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 972 人关注过本帖
标题:使用updatrpanel出錯
只看楼主 加入收藏
gaoshenghua
Rank: 1
等 级:新手上路
帖 子:50
专家分:0
注 册:2010-10-28
结帖率:85.71%
收藏
已结贴  问题点数:10 回复次数:12 
使用updatrpanel出錯
我使用了UpdatePanel和UpdateProgress ,點擊查詢什麼的都正常,因為我需要將GridView數據導出,在我點擊導出按鈕時候出錯,提示畫面如下:
Sys.WebForms.PageRequestManagerParserErrorException 解析錯誤
图片附件: 游客没有浏览图片的权限,请 登录注册

還請大蝦們幫我看看
搜索更多相关主题的帖子: updatrpanel 
2010-11-01 17:28
筱晓绾
Rank: 10Rank: 10Rank: 10
来 自:湖南
等 级:贵宾
威 望:12
帖 子:512
专家分:1736
注 册:2010-9-1
收藏
得分:10 
查看你的标签是否都成对出现?还有UpdatePanel上面要用到<asp:ScriptManager ID="smPage" runat="server"></asp:ScriptManager>要放在body里面哦!
2010-11-01 17:37
gaoshenghua
Rank: 1
等 级:新手上路
帖 子:50
专家分:0
注 册:2010-10-28
收藏
得分:0 
回复 2楼 筱晓绾
版主你好,剛問題是解決了!
謝謝,那本來我點擊查詢的時候,會有一個加載的gif的log。那麼現在用了你的辦法,將:ScriptManager
移到body前,就是這個功能實現不了了。
2010-11-01 18:42
筱晓绾
Rank: 10Rank: 10Rank: 10
来 自:湖南
等 级:贵宾
威 望:12
帖 子:512
专家分:1736
注 册:2010-9-1
收藏
得分:0 
<body>
//当然这里还可以添加<from>之类的标签
<asp:ScriptManager ID="smPage" runat="server"></asp:ScriptManager>
<UpdatePanel>...</UpdatePanel>
</body>

LZ你查看下是不是这样的顺序呢?
2010-11-01 19:34
gaoshenghua
Rank: 1
等 级:新手上路
帖 子:50
专家分:0
注 册:2010-10-28
收藏
得分:0 
回复 4楼 筱晓绾
將ScriptManager 移進body 同樣的錯誤。同樣的提示。。。
图片附件: 游客没有浏览图片的权限,请 登录注册
2010-11-01 20:01
筱晓绾
Rank: 10Rank: 10Rank: 10
来 自:湖南
等 级:贵宾
威 望:12
帖 子:512
专家分:1736
注 册:2010-9-1
收藏
得分:0 
介不介意把你的源码发上来看看???
2010-11-02 09:04
gaoshenghua
Rank: 1
等 级:新手上路
帖 子:50
专家分:0
注 册:2010-10-28
收藏
得分:0 
程序代码:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="default.aspx.cs" Inherits="cangku._default" %>

<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.">

<html xmlns="http://www." >
<head runat="server">
    <title></title>
    <style type="text/css">
        .style1
        {
            font: normal small-caps bold 100% serif;
            background: #FFFFFF;
            text-align: left;
            color: #0000FF;
        }
    </style>
  
</head>
<body>
  
    <form id="form1" runat="server">

    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <div class="style1">
                <asp:ScriptManager ID="ScriptManager1" runat="server">
                </asp:ScriptManager>
                倉 庫 對 點 明 細<br />
                <br />
                開始時間:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                <cc1:CalendarExtender ID="TextBox1_CalendarExtender" runat="server"
                    Enabled="True" Format="yyyy-MM-dd" TargetControlID="TextBox1">
                </cc1:CalendarExtender>
                <asp:DropDownList ID="DropDownList1" runat="server" Height="22px"
                    style="margin-top: 0px" Width="42px">
                    <asp:ListItem>00</asp:ListItem>
                    <asp:ListItem>01</asp:ListItem>
                    <asp:ListItem>02</asp:ListItem>
                    <asp:ListItem>03</asp:ListItem>
                    <asp:ListItem>04</asp:ListItem>
                    <asp:ListItem>05</asp:ListItem>
                    <asp:ListItem>06</asp:ListItem>
                    <asp:ListItem>07</asp:ListItem>
                    <asp:ListItem>08</asp:ListItem>
                    <asp:ListItem>09</asp:ListItem>
                    <asp:ListItem>10</asp:ListItem>
                    <asp:ListItem>11</asp:ListItem>
                    <asp:ListItem>12</asp:ListItem>
                    <asp:ListItem>13</asp:ListItem>
                    <asp:ListItem>14</asp:ListItem>
                    <asp:ListItem>15</asp:ListItem>
                    <asp:ListItem>16</asp:ListItem>
                    <asp:ListItem>17</asp:ListItem>
                    <asp:ListItem>18</asp:ListItem>
                    <asp:ListItem>19</asp:ListItem>
                    <asp:ListItem>20</asp:ListItem>
                    <asp:ListItem>21</asp:ListItem>
                    <asp:ListItem>22</asp:ListItem>
                    <asp:ListItem>23</asp:ListItem>
                </asp:DropDownList>
                點<asp:DropDownList ID="DropDownList2" runat="server" Height="22px" Width="42px">
                    <asp:ListItem>00</asp:ListItem>
                    <asp:ListItem>01</asp:ListItem>
                    <asp:ListItem>02</asp:ListItem>
                    <asp:ListItem>03</asp:ListItem>
                    <asp:ListItem>04</asp:ListItem>
                    <asp:ListItem>05</asp:ListItem>
                    <asp:ListItem>06</asp:ListItem>
                    <asp:ListItem>07</asp:ListItem>
                    <asp:ListItem>08</asp:ListItem>
                    <asp:ListItem>09</asp:ListItem>
                    <asp:ListItem>10</asp:ListItem>
                    <asp:ListItem>11</asp:ListItem>
                    <asp:ListItem>12</asp:ListItem>
                    <asp:ListItem>13</asp:ListItem>
                    <asp:ListItem>14</asp:ListItem>
                    <asp:ListItem>15</asp:ListItem>
                    <asp:ListItem>16</asp:ListItem>
                    <asp:ListItem>17</asp:ListItem>
                    <asp:ListItem>18</asp:ListItem>
                    <asp:ListItem>19</asp:ListItem>
                    <asp:ListItem>20</asp:ListItem>
                    <asp:ListItem>21</asp:ListItem>
                    <asp:ListItem>22</asp:ListItem>
                    <asp:ListItem>23</asp:ListItem>
                    <asp:ListItem>24</asp:ListItem>
                    <asp:ListItem>25</asp:ListItem>
                    <asp:ListItem>26</asp:ListItem>
                    <asp:ListItem>27</asp:ListItem>
                    <asp:ListItem>28</asp:ListItem>
                    <asp:ListItem>29</asp:ListItem>
                    <asp:ListItem>30</asp:ListItem>
                    <asp:ListItem>31</asp:ListItem>
                    <asp:ListItem>32</asp:ListItem>
                    <asp:ListItem>33</asp:ListItem>
                    <asp:ListItem>34</asp:ListItem>
                    <asp:ListItem>35</asp:ListItem>
                    <asp:ListItem>36</asp:ListItem>
                    <asp:ListItem>37</asp:ListItem>
                    <asp:ListItem>38</asp:ListItem>
                    <asp:ListItem>39</asp:ListItem>
                    <asp:ListItem>40</asp:ListItem>
                    <asp:ListItem>41</asp:ListItem>
                    <asp:ListItem>42</asp:ListItem>
                    <asp:ListItem>43</asp:ListItem>
                    <asp:ListItem>44</asp:ListItem>
                    <asp:ListItem>45</asp:ListItem>
                    <asp:ListItem>46</asp:ListItem>
                    <asp:ListItem>47</asp:ListItem>
                    <asp:ListItem>48</asp:ListItem>
                    <asp:ListItem>49</asp:ListItem>
                    <asp:ListItem>50</asp:ListItem>
                    <asp:ListItem>51</asp:ListItem>
                    <asp:ListItem>52</asp:ListItem>
                    <asp:ListItem>53</asp:ListItem>
                    <asp:ListItem>54</asp:ListItem>
                    <asp:ListItem>55</asp:ListItem>
                    <asp:ListItem>56</asp:ListItem>
                    <asp:ListItem>57</asp:ListItem>
                    <asp:ListItem>58</asp:ListItem>
                    <asp:ListItem>59</asp:ListItem>
                </asp:DropDownList>
                分
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                    ControlToValidate="TextBox1" ErrorMessage="開始日期不能為空" Font-Bold="False"
                    BorderStyle="Dotted"></asp:RequiredFieldValidator>
                <br />
                <br />
                結束時間:<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                <cc1:CalendarExtender ID="TextBox2_CalendarExtender" runat="server"
                    Enabled="True" Format="yyyy-MM-dd" TargetControlID="TextBox2">
                </cc1:CalendarExtender>
                <asp:DropDownList ID="DropDownList3" runat="server" Height="22px" Width="42px">
                    <asp:ListItem>00</asp:ListItem>
                    <asp:ListItem>01</asp:ListItem>
                    <asp:ListItem>02</asp:ListItem>
                    <asp:ListItem>03</asp:ListItem>
                    <asp:ListItem>04</asp:ListItem>
                    <asp:ListItem>05</asp:ListItem>
                    <asp:ListItem>06</asp:ListItem>
                    <asp:ListItem>07</asp:ListItem>
                    <asp:ListItem>08</asp:ListItem>
                    <asp:ListItem>09</asp:ListItem>
                    <asp:ListItem>10</asp:ListItem>
                    <asp:ListItem>11</asp:ListItem>
                    <asp:ListItem>12</asp:ListItem>
                    <asp:ListItem>13</asp:ListItem>
                    <asp:ListItem>14</asp:ListItem>
                    <asp:ListItem>15</asp:ListItem>
                    <asp:ListItem>16</asp:ListItem>
                    <asp:ListItem>17</asp:ListItem>
                    <asp:ListItem>18</asp:ListItem>
                    <asp:ListItem>19</asp:ListItem>
                    <asp:ListItem>20</asp:ListItem>
                    <asp:ListItem>21</asp:ListItem>
                    <asp:ListItem>22</asp:ListItem>
                    <asp:ListItem>23</asp:ListItem>
                </asp:DropDownList>
                點<asp:DropDownList ID="DropDownList4" runat="server" Height="22px" Width="42px">
                    <asp:ListItem>00</asp:ListItem>
                    <asp:ListItem>01</asp:ListItem>
                    <asp:ListItem>02</asp:ListItem>
                    <asp:ListItem>03</asp:ListItem>
                    <asp:ListItem>04</asp:ListItem>
                    <asp:ListItem>05</asp:ListItem>
                    <asp:ListItem>06</asp:ListItem>
                    <asp:ListItem>07</asp:ListItem>
                    <asp:ListItem>08</asp:ListItem>
                    <asp:ListItem>09</asp:ListItem>
                    <asp:ListItem>10</asp:ListItem>
                    <asp:ListItem>11</asp:ListItem>
                    <asp:ListItem>12</asp:ListItem>
                    <asp:ListItem>13</asp:ListItem>
                    <asp:ListItem>14</asp:ListItem>
                    <asp:ListItem>15</asp:ListItem>
                    <asp:ListItem>16</asp:ListItem>
                    <asp:ListItem>17</asp:ListItem>
                    <asp:ListItem>18</asp:ListItem>
                    <asp:ListItem>19</asp:ListItem>
                    <asp:ListItem>20</asp:ListItem>
                    <asp:ListItem>21</asp:ListItem>
                    <asp:ListItem>22</asp:ListItem>
                    <asp:ListItem>23</asp:ListItem>
                    <asp:ListItem>24</asp:ListItem>
                    <asp:ListItem>25</asp:ListItem>
                    <asp:ListItem>26</asp:ListItem>
                    <asp:ListItem>27</asp:ListItem>
                    <asp:ListItem>28</asp:ListItem>
                    <asp:ListItem>29</asp:ListItem>
                    <asp:ListItem>30</asp:ListItem>
                    <asp:ListItem>31</asp:ListItem>
                    <asp:ListItem>32</asp:ListItem>
                    <asp:ListItem>33</asp:ListItem>
                    <asp:ListItem>34</asp:ListItem>
                    <asp:ListItem>35</asp:ListItem>
                    <asp:ListItem>36</asp:ListItem>
                    <asp:ListItem>37</asp:ListItem>
                    <asp:ListItem>38</asp:ListItem>
                    <asp:ListItem>39</asp:ListItem>
                    <asp:ListItem>40</asp:ListItem>
                    <asp:ListItem>41</asp:ListItem>
                    <asp:ListItem>42</asp:ListItem>
                    <asp:ListItem>43</asp:ListItem>
                    <asp:ListItem>44</asp:ListItem>
                    <asp:ListItem>45</asp:ListItem>
                    <asp:ListItem>46</asp:ListItem>
                    <asp:ListItem>47</asp:ListItem>
                    <asp:ListItem>48</asp:ListItem>
                    <asp:ListItem>49</asp:ListItem>
                    <asp:ListItem>50</asp:ListItem>
                    <asp:ListItem>51</asp:ListItem>
                    <asp:ListItem>52</asp:ListItem>
                    <asp:ListItem>53</asp:ListItem>
                    <asp:ListItem>54</asp:ListItem>
                    <asp:ListItem>55</asp:ListItem>
                    <asp:ListItem>56</asp:ListItem>
                    <asp:ListItem>57</asp:ListItem>
                    <asp:ListItem>58</asp:ListItem>
                    <asp:ListItem>59</asp:ListItem>
                </asp:DropDownList>
                分<br />
                <br />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </div>
            <br />
            <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="查  詢"
                UseSubmitBehavior="False" />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="Button2" runat="server" Height="26px" onclick="Button2_Click"
                Text="導出" Width="64px" />
            <br />
            <asp:UpdateProgress ID="UpdateProgress1" runat="server"
                AssociatedUpdatePanelID="UpdatePanel1">
                <ProgressTemplate>
                    &nbsp;&nbsp;
                    <img alt="" src="a8.gif" style="width: 36px; height: 32px" /> 數據撈取中,請耐心等待....
                </ProgressTemplate>
            </asp:UpdateProgress>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
                BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px"
                CellPadding="4" ForeColor="Black" GridLines="Vertical"
                onselectedindexchanged="GridView1_SelectedIndexChanged">
                <FooterStyle BackColor="#CCCC99" />
                <RowStyle BackColor="#F7F7DE" />
                <Columns>
                    <asp:BoundField DataField="f" HeaderText="箱號" />
                    <asp:BoundField DataField="i" HeaderText="流單" />
                    <asp:BoundField DataField="qty" HeaderText="數量" />
                    <asp:BoundField DataField="liaohao" HeaderText="料號" />
                    <asp:BoundField DataField="nam_item" HeaderText="品名" />
                    <asp:BoundField DataField="nam_items" HeaderText="商編" />
                    <asp:BoundField DataField="p_lot_branchno" HeaderText="支號" />
                    <asp:BoundField DataField="outlotno" HeaderText="出貨批號" />
                    <asp:BoundField DataField="rcv_dtm" HeaderText="時間" />
                </Columns>
                <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
            <br />
        </ContentTemplate>



        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
        </Triggers>



    </asp:UpdatePanel>
    </form>
</body>
</html>
这是设计界面的代码。
程序代码:
using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using System.Data.Odbc;
using System.Data.OleDb;
using System.using System.Text;
using namespace cangku
{
    public partial class _default : System.Web.UI.Page
    {
        public string con1 = "Provider=IBMDADB2;Database=mes;HOSTNAME=***********;PROTOCOL=TCPIP;PORT=50001;uid=********;pwd=**********";
        protected void Page_Load(object sender, EventArgs e)
        {
            if (base.IsPostBack)
            {
                this.query_data();
            }
        }
        public void query_data()
        {
            string one = DropDownList1.SelectedValue.ToString();
            string two = DropDownList2.SelectedValue.ToString();
            string three = DropDownList3.SelectedValue.ToString();
            string four = DropDownList4.SelectedValue.ToString();
            string time1 = TextBox1.Text + "-" + one + "." + two + ".00.000000";
            string time2 = TextBox2.Text + "-" + three + "." + four + ".00.000000";

            OleDbConnection myconnection = new OleDbConnection();
            myconnection.ConnectionString = con1;
            myconnection.Open();
           string sq1="select DISTINCT(F),I,QTY,LIAOHAO,NAM_ITEM,NAM_ITEMS,OUTLOTNO,P_LOT_BRANCHNO,RCV_DTM from  ";
           string sq2=" (SELECT DISTINCT(F),I,QTY,LIAOHAO,NAM_ITEM,NAM_ITEMS,RCV_DTM FROM ";
           string sq3="  (SELECT DISTINCT(RUNCARD_ID)AS F,(PACKNO)AS I,nam_item,nam_items,rcv_dtm,a.cod_item AS LIAOHAO FROM (SELECT  runcard_id,packno,nam_item,nam_items,rcv_dtm,a.cod_item FROM ";
           string sq4 = "  BRPACKCONVERT AS A,BWBOTTOM AS B WHERE A.PACK_NO=B.PACKNO AND  eventdatetime >='" + time1 + "'" + "AND  eventdatetime <='" + time2 + "' )AS A  ";
           string sq5="LEFT JOIN (select lotno,P_LOT_BRANCHNO  from  fhlotoperation)  B on  A.RUNCARD_ID=B.LOTNO  )AS D,(SELECT NUM_ORD AS J,pack_no AS O,cod_item,SUM(QTY)AS QTY FROM  ";
           string sq6 = "BRPACKCONVERT WHERE  eventdatetime >='" + time1 + "'" + "AND  eventdatetime <='" + time2 + "' GROUP BY NUM_ORD,COD_ITEM,PACK_NO)AS E WHERE D.F=E.J AND D.I=E.O ORDER BY I) AS A  ";
           string sq7 = "LEFT JOIN(select lotno,P_LOT_BRANCHNO  from  fhlotoperation)  B on  F=B.LOTNO  ";
           string sq8= "LEFT JOIN (SELECT OUTLOTNO,LOTNO FROM BWLOT ) C ON F=C.LOTNO order by f,i,rcv_dtm ";
           
           
            //string sq1 = " select  DISTINCT(PACKNO),runcard_id,a.cod_item,NAM_ITEM,NAM_ITEMS,P_LOT_BRANCHNO,OUTLOTNO,RCV_DTM from ";
           // string sq2 = "(SELECT  runcard_id,packno,nam_item,nam_items,rcv_dtm,a.cod_item FROM BRPACKCONVERT AS A,BWBOTTOM AS B WHERE A.PACK_NO=B.PACKNO AND  eventdatetime >='" + time1 + "'" + "AND  eventdatetime <='" + time2 + "')  AS A ";
            //string sq3 = "LEFT JOIN(select lotno,P_LOT_BRANCHNO  from  fhlotoperation)  B on  A.RUNCARD_ID=B.LOTNO ";
            //string sq4 = "LEFT JOIN (SELECT OUTLOTNO,LOTNO FROM BWLOT ) C ON A.RUNCARD_ID=C.LOTNO ORDER BY PACKNO,RCV_DTM ";
            sq1 = sq1 + sq2 + sq3 + sq4+sq5+sq6+sq7+sq8;
            OleDbCommand mycmd = new OleDbCommand(sq1, myconnection);
            OleDbDataAdapter adapter = new OleDbDataAdapter();
            adapter.SelectCommand = mycmd;
            DataSet myds = new DataSet();
            adapter.Fill(myds);
            DataView dv = new DataView();
            dv = myds.Tables[0].DefaultView;
            myconnection.Close();
            GridView1.DataSource = dv;
            GridView1.DataBind();
        }
        

        protected void Button1_Click(object sender, EventArgs e)
        {
            query_data();
        }

      

        protected void GridView1_SelectedIndexChanged(object sender, EventArgs e)
        {

        }
        public static void Export(string Filename, GridView gridview, Page page)
        {
            page.Response.Clear();
            page.Response.Charset = "big5";
            page.Response.ContentType = "application/ms-excel";
            page.Response.ContentEncoding = Encoding.GetEncoding("big5");
            page.Response.AppendHeader("content-disposition", "attachment;filename=\"" + HttpUtility.UrlEncode(Filename + DateTime.Now.ToShortDateString(), Encoding.UTF8) + ".xls\"");
            StringWriter sw = new StringWriter();
            HtmlTextWriter htw = new HtmlTextWriter(sw);
            gridview.RenderControl(htw);
            page.Response.Write(sw.ToString());
            page.Response.End();
        }

        /// <summary>
        /// 此方法必重写,否则会出错
        /// </summary>
        /// <param name="control"></param>
        ///
        public override void VerifyRenderingInServerForm(Control control)
        {
        }

        protected void Button2_Click(object sender, EventArgs e)
        {
            this.GridView1.AllowPaging = false;
            this.GridView1.AllowSorting = false;
            this.GridView1.DataBind();
            Export("cangchu", this.GridView1, this.Page);
        }

      
     
    }
}
全部代码都在这里,比较简单。我只是想用个有加载图标的!所以使用了UpdatePanel
2010-11-02 10:02
筱晓绾
Rank: 10Rank: 10Rank: 10
来 自:湖南
等 级:贵宾
威 望:12
帖 子:512
专家分:1736
注 册:2010-9-1
收藏
得分:0 
呵呵 知道了。。。问题还是出在语法上面。。。我把DropDownList里面的内容省略点啊!
   
程序代码:
<form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>//应该放这里
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <div class="style1">
                //<asp:ScriptManager ID="ScriptManager1" runat="server">
                //</asp:ScriptManager>
                倉 庫 對 點 明 細<br />
                <br />
                開始時間:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                <cc1:CalendarExtender ID="TextBox1_CalendarExtender" runat="server"
                    Enabled="True" Format="yyyy-MM-dd" TargetControlID="TextBox1">
                </cc1:CalendarExtender>
                <asp:DropDownList ID="DropDownList1" runat="server" Height="22px"
                    style="margin-top: 0px" Width="42px">
                    <asp:ListItem>00</asp:ListItem>
                    <asp:ListItem>01</asp:ListItem>
                </asp:DropDownList>
                點<asp:DropDownList ID="DropDownList2" runat="server" Height="22px" Width="42px">
                    <asp:ListItem>00</asp:ListItem>
                  </asp:DropDownList>
                分
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                    ControlToValidate="TextBox1" ErrorMessage="開始日期不能為空" Font-Bold="False"
                    BorderStyle="Dotted"></asp:RequiredFieldValidator>
                <br />
                <br />
                結束時間:<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                <cc1:CalendarExtender ID="TextBox2_CalendarExtender" runat="server"
                    Enabled="True" Format="yyyy-MM-dd" TargetControlID="TextBox2">
                </cc1:CalendarExtender>
                <asp:DropDownList ID="DropDownList3" runat="server" Height="22px" Width="42px">
                    <asp:ListItem>00</asp:ListItem>
                    <asp:ListItem>01</asp:ListItem>
                </asp:DropDownList>
                點<asp:DropDownList ID="DropDownList4" runat="server" Height="22px" Width="42px">
                    <asp:ListItem>00</asp:ListItem>
                    <asp:ListItem>01</asp:ListItem>
                   </asp:DropDownList>
                分<br />
                <br />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </div>
            <br />
            <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="查  詢"
                UseSubmitBehavior="False" />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="Button2" runat="server" Height="26px" onclick="Button2_Click"
                Text="導出" Width="64px" />
            <br />
            <asp:UpdateProgress ID="UpdateProgress1" runat="server"
                AssociatedUpdatePanelID="UpdatePanel1">
                <ProgressTemplate>
                    &nbsp;&nbsp;
                    <img alt="" src="a8.gif" style="width: 36px; height: 32px" /> 數據撈取中,請耐心等待....
                </ProgressTemplate>
            </asp:UpdateProgress>
            <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
                BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px"
                CellPadding="4" ForeColor="Black" GridLines="Vertical"
                onselectedindexchanged="GridView1_SelectedIndexChanged">
                <FooterStyle BackColor="#CCCC99" />
                <RowStyle BackColor="#F7F7DE" />
                <Columns>
                    <asp:BoundField DataField="f" HeaderText="箱號" />
                    <asp:BoundField DataField="i" HeaderText="流單" />
                    <asp:BoundField DataField="qty" HeaderText="數量" />
                    <asp:BoundField DataField="liaohao" HeaderText="料號" />
                    <asp:BoundField DataField="nam_item" HeaderText="品名" />
                    <asp:BoundField DataField="nam_items" HeaderText="商編" />
                    <asp:BoundField DataField="p_lot_branchno" HeaderText="支號" />
                    <asp:BoundField DataField="outlotno" HeaderText="出貨批號" />
                    <asp:BoundField DataField="rcv_dtm" HeaderText="時間" />
                </Columns>
                <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
            <br />
        </ContentTemplate>
        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    </form>
</body>

详细语法介绍可以参考http://www.
2010-11-02 10:13
gaoshenghua
Rank: 1
等 级:新手上路
帖 子:50
专家分:0
注 册:2010-10-28
收藏
得分:0 
版主。我觉得吧,那个东西放哪边不重要,重要的是一个问题,我现在点查询那个加载的log会出现,我点导出那个按钮,同样出现加载的log
问题就是处在这里,按照道理,应该是我点查询出现加载的log图标,点导出,就会导出excel
那现在问题的关键就在这里了,提示的出错仍然还在!
迷茫中....
版主看来还要麻烦你看看了
2010-11-02 10:34
筱晓绾
Rank: 10Rank: 10Rank: 10
来 自:湖南
等 级:贵宾
威 望:12
帖 子:512
专家分:1736
注 册:2010-9-1
收藏
得分:0 
<form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>//应该放这里
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Conditional">
        <ContentTemplate>
            <div class="style1">
                //<asp:ScriptManager ID="ScriptManager1" runat="server">
                //</asp:ScriptManager>
                倉 庫 對 點 明 細<br />
                <br />
                開始時間:<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                <cc1:CalendarExtender ID="TextBox1_CalendarExtender" runat="server"
                    Enabled="True" Format="yyyy-MM-dd" TargetControlID="TextBox1">
                </cc1:CalendarExtender>
                <asp:DropDownList ID="DropDownList1" runat="server" Height="22px"
                    style="margin-top: 0px" Width="42px">
                    <asp:ListItem>00</asp:ListItem>
                    <asp:ListItem>01</asp:ListItem>
                </asp:DropDownList>
                點<asp:DropDownList ID="DropDownList2" runat="server" Height="22px" Width="42px">
                    <asp:ListItem>00</asp:ListItem>
                  </asp:DropDownList>
               
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server"
                    ControlToValidate="TextBox1" ErrorMessage="開始日期不能為空" Font-Bold="False"
                    BorderStyle="Dotted"></asp:RequiredFieldValidator>
                <br />
                <br />
                結束時間:<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
                <cc1:CalendarExtender ID="TextBox2_CalendarExtender" runat="server"
                    Enabled="True" Format="yyyy-MM-dd" TargetControlID="TextBox2">
                </cc1:CalendarExtender>
                <asp:DropDownList ID="DropDownList3" runat="server" Height="22px" Width="42px">
                    <asp:ListItem>00</asp:ListItem>
                    <asp:ListItem>01</asp:ListItem>
                </asp:DropDownList>
                點<asp:DropDownList ID="DropDownList4" runat="server" Height="22px" Width="42px">
                    <asp:ListItem>00</asp:ListItem>
                    <asp:ListItem>01</asp:ListItem>
                   </asp:DropDownList>
                分<br />
                <br />
                &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            </div>
            <br />
            <asp:Button ID="Button1" runat="server" onclick="Button1_Click" Text="查  詢"
                UseSubmitBehavior="False" />
            &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
            <asp:Button ID="Button2" runat="server" Height="26px" onclick="Button2_Click"
                Text="導出" Width="64px" />
            <br />
              <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False"
                BackColor="White" BorderColor="#DEDFDE" BorderStyle="None" BorderWidth="1px"
                CellPadding="4" ForeColor="Black" GridLines="Vertical"
                onselectedindexchanged="GridView1_SelectedIndexChanged">
                <FooterStyle BackColor="#CCCC99" />
                <RowStyle BackColor="#F7F7DE" />
                <Columns>
                    <asp:BoundField DataField="f" HeaderText="箱號" />
                    <asp:BoundField DataField="i" HeaderText="流單" />
                    <asp:BoundField DataField="qty" HeaderText="數量" />
                    <asp:BoundField DataField="liaohao" HeaderText="料號" />
                    <asp:BoundField DataField="nam_item" HeaderText="品名" />
                    <asp:BoundField DataField="nam_items" HeaderText="商編" />
                    <asp:BoundField DataField="p_lot_branchno" HeaderText="支號" />
                    <asp:BoundField DataField="outlotno" HeaderText="出貨批號" />
                    <asp:BoundField DataField="rcv_dtm" HeaderText="時間" />
                </Columns>
                <PagerStyle BackColor="#F7F7DE" ForeColor="Black" HorizontalAlign="Right" />
                <SelectedRowStyle BackColor="#CE5D5A" Font-Bold="True" ForeColor="White" />
                <HeaderStyle BackColor="#6B696B" Font-Bold="True" ForeColor="White" />
                <AlternatingRowStyle BackColor="White" />
            </asp:GridView>
            <br />
        </ContentTemplate>
         <asp:UpdateProgress ID="UpdateProgress1" runat="server"
                AssociatedUpdatePanelID="UpdatePanel1">
                <ProgressTemplate>
                    &nbsp;&nbsp;
                    <img alt="" src="a8.gif" style="width: 36px; height: 32px" /> 數據撈取中,請耐心等待....
                </ProgressTemplate>
            </asp:UpdateProgress>

        <Triggers>
            <asp:AsyncPostBackTrigger ControlID="Button1" EventName="Click" />
        </Triggers>
    </asp:UpdatePanel>
    </form>
</body>

就在刚才的基础上改的,如果你不想加载的时候调用,那加载事件你就设为空,即将           
           if (base.IsPostBack)
            {
                this.query_data();
            }
注释掉。
2010-11-02 10:46
快速回复:使用updatrpanel出錯
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.047337 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved