首页 新闻 会员 周边 捐助

急 按钮不触发

0
悬赏园豆:100 [已关闭问题] 关闭于 2008-10-15 19:16

页面采用微软的AJAX框架,当一开始进入页面,且立即点击按钮时能够正确跳转,但如果在选择列中勾选或者过了几秒种后再点击按钮时,按钮没有反应,也不执行Click事件。调了一下午也没弄出个原因来,还望大侠出手相救。

前台代码:


 1<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
 2    <base target="_self" />
 3    <div>
 4        <asp:Label ID="lblToBeParchased" runat="server" Text="【待采购订单】" SkinID="Title"></asp:Label>
 5        <br />
 6        <asp:Panel ID="Panel1" runat="server" Width="820px" Height="420px" BorderStyle="Outset" ScrollBars=Auto>
 7                    <asp:Label ID="lblCheckOrder" runat="server" Text="请选择订单:"></asp:Label>
 8                    
 9                   <asp:Panel ID="pnlToBeParchased" runat="server" Width="1000px" Height="400px"><asp:GridView ID="gvToBeParchased" runat="server" DataKeyNames="IAuto_id" OnRowDataBound="gvToBeParchased_RowDataBound"
10                                    AutoGenerateColumns="False">
11                                    <Columns>
12                                        <asp:TemplateField ShowHeader="False">
13                                            <ItemStyle Width="4px" />
14                                            <HeaderStyle Width="4px" />
15                                            <ItemTemplate>
16                                                <asp:CheckBox ID="chkSelectBox" runat="server"></asp:CheckBox>
17                                            </ItemTemplate>
18                                        </asp:TemplateField>
19                                        <asp:BoundField DataField="IAuto_id" HeaderText="自动编号" Visible="False" />
20                                        <asp:BoundField HeaderText="订单号" DataField="or_code">
21                                        </asp:BoundField>
22                                        <asp:BoundField HeaderText="产品名" DataField="p_name">
23                                        </asp:BoundField>
24                                        <asp:BoundField HeaderText="规格" DataField="p_spec">
25                                        </asp:BoundField>
26                                        <asp:BoundField HeaderText="交货期" DataField="oi_date" DataFormatString="{0:yyyy-MM-dd}"
27                                            HtmlEncode="False">
28                                        </asp:BoundField>
29                                        <asp:BoundField HeaderText="订单量" DataField="oi_num">
30                                        </asp:BoundField>
31                                        <asp:BoundField HeaderText="玻管编号" DataField="p_tubecode">
32                                        </asp:BoundField>
33                                        <asp:BoundField HeaderText="玻管量 " DataField="tub_num">
34                                        </asp:BoundField>
35                                        <asp:BoundField HeaderText="瓶盖名" DataField="p_clocode">
36                                        </asp:BoundField>
37                                        <asp:BoundField HeaderText="瓶盖总量" DataField="pur_clo_num">
38                                        </asp:BoundField>
39                                        <asp:BoundField HeaderText="已采购量" DataField="tub_received">
40                                        </asp:BoundField>
41                                        <asp:BoundField HeaderText="已采购量" DataField="clo_received">
42                                        </asp:BoundField>
43                                    </Columns>
44                                </asp:GridView>
45                    </asp:Panel>
46                </asp:Panel> 
47        <asp:UpdatePanel ID="upnlToBeParchased" runat="server" ChildrenAsTriggers="False"
48            UpdateMode="Conditional">
49            <ContentTemplate>
50                
51                <table width="800">
52                        <tbody>
53                            <tr>
54                                <td align="center">
55                                    <table>
56                                        <tbody>
57                                            <tr>
58                                                <td style="width: 318px" colspan="3">
59                                                    <asp:ImageButton ID="ibtnNextStep" OnClick="ibtnNextStep_Click" runat="server" ImageUrl="~/Images/NextStep.gif">
60                                                    </asp:ImageButton>
61                                                   
62                                                </td>
63                                            </tr>
64                                        </tbody>
65                                    </table>
66                                </td>
67                            </tr>
68                        </tbody>
69                    </table>
70            </ContentTemplate>
71            <Triggers>
72                <asp:PostBackTrigger ControlID="ibtnNextStep" />
73            </Triggers>
74        </asp:UpdatePanel>
75    </div>
76</asp:Content>

 

Click事件:


 1protected void ibtnNextStep_Click(object sender, ImageClickEventArgs e)
 2    {
 3        string str = "";
 4        for(int i=0;i<gvToBeParchased.Rows.Count;i++)
 5        {
 6            CheckBox chk = (CheckBox)gvToBeParchased.Rows[i].Cells[0].FindControl("chkSelectBox");
 7            if (chk.Checked)
 8            {
 9                str += gvToBeParchased.DataKeys[i]["IAuto_id"+ ",";
10            }

11        }

12        if (str == "")
13        {
14            ScriptManager.RegisterClientScriptBlock(upnlToBeParchased, typeof (UpdatePanel), "okBack","alert( '请至少选择一条数据 ');"true);
15            return;
16        }

17        if (str.Substring(str.Length - 11== ",")
18        {
19            str = str.Substring(0, str.Length - 1);
20        }

21        Session["orders"= str;
22        Response.Redirect("PurDetail.aspx?mode=add&type=" + ViewState["type"].ToString().Trim() + "&source=2");
23    }
神奇小子的主页 神奇小子 | 初学一级 | 园豆:5
提问于:2008-10-15 17:37
< >
分享
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册