Skip to content
This repository
Browse code

Merge pull request #26 from housemeow/25_newCustomer

fix the dorpdownlist of date and cancle event reload
  • Loading branch information...
commit 6636cd306dd284d66b8bcd70aed5c756a1c1b52c 2 parents 1254032 + 4200a38
housemeow authored October 05, 2012
BIN  99590306_homework.suo
Binary file not shown
13  99590306_homework/10_Security/office/customer/customerCreate.aspx
@@ -112,7 +112,18 @@
112 112
                 </asp:TemplateField>
113 113
                 <asp:BoundField DataField="address" HeaderText="地址" SortExpression="address" />
114 114
                 <asp:BoundField DataField="comment" HeaderText="備註" SortExpression="comment" />
115  
-                <asp:CommandField ShowInsertButton="True" CancelText="取消" InsertText="新增" />
  115
+                <asp:TemplateField ShowHeader="False">
  116
+                    <InsertItemTemplate>
  117
+                        <asp:Button ID="Button1" runat="server" CausesValidation="True" 
  118
+                            CommandName="Insert" Text="新增" />
  119
+                        &nbsp;<asp:Button ID="Button2" runat="server" CausesValidation="False" 
  120
+                            CommandName="Cancel" onclick="Button2_Click" Text="取消" />
  121
+                    </InsertItemTemplate>
  122
+                    <ItemTemplate>
  123
+                        <asp:Button ID="Button1" runat="server" CausesValidation="False" 
  124
+                            CommandName="New" Text="新增" />
  125
+                    </ItemTemplate>
  126
+                </asp:TemplateField>
116 127
             </Fields>
117 128
             <FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
118 129
             <HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
15  99590306_homework/10_Security/office/customer/customerCreate.aspx.cs
@@ -11,10 +11,12 @@ public partial class _10_Security_office_customer_customerCreate : System.Web.UI
11 11
 {
12 12
     protected void Page_Load(object sender, EventArgs e)
13 13
     {
14  
-        //if (!IsPostBack)
15  
-        //{
16  
-        birthdayControl();
17  
-        //}
  14
+
  15
+        if (!IsPostBack || (Session["isCancle"] !=null && Session["isCancle"].Equals(true)))
  16
+        {    
  17
+            birthdayControl();
  18
+            Session["isCancle"] = null;
  19
+        }
18 20
     }
19 21
     private void birthdayControl()
20 22
     {
@@ -158,4 +160,9 @@ protected void healthButton_Click(object sender, EventArgs e)
158 160
             healthTextBox.Text += healthDropDownList.SelectedValue;
159 161
         }
160 162
     }
  163
+
  164
+    protected void Button2_Click(object sender, EventArgs e)
  165
+    {
  166
+        Server.Transfer("customerCreate.aspx");
  167
+    }
161 168
 }

0 notes on commit 6636cd3

Please sign in to comment.
Something went wrong with that request. Please try again.