Permalink
Browse files

Merge pull request #26 from housemeow/25_newCustomer

fix the dorpdownlist of date and cancle event reload
  • Loading branch information...
2 parents 1254032 + 4200a38 commit 6636cd306dd284d66b8bcd70aed5c756a1c1b52c @housemeow committed Oct 5, 2012
View
BIN 99590306_homework.suo
Binary file not shown.
View
13 99590306_homework/10_Security/office/customer/customerCreate.aspx
@@ -112,7 +112,18 @@
</asp:TemplateField>
<asp:BoundField DataField="address" HeaderText="地址" SortExpression="address" />
<asp:BoundField DataField="comment" HeaderText="備註" SortExpression="comment" />
- <asp:CommandField ShowInsertButton="True" CancelText="取消" InsertText="新增" />
+ <asp:TemplateField ShowHeader="False">
+ <InsertItemTemplate>
+ <asp:Button ID="Button1" runat="server" CausesValidation="True"
+ CommandName="Insert" Text="新增" />
+ &nbsp;<asp:Button ID="Button2" runat="server" CausesValidation="False"
+ CommandName="Cancel" onclick="Button2_Click" Text="取消" />
+ </InsertItemTemplate>
+ <ItemTemplate>
+ <asp:Button ID="Button1" runat="server" CausesValidation="False"
+ CommandName="New" Text="新增" />
+ </ItemTemplate>
+ </asp:TemplateField>
</Fields>
<FooterStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
<HeaderStyle BackColor="#990000" Font-Bold="True" ForeColor="White" />
View
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
{
protected void Page_Load(object sender, EventArgs e)
{
- //if (!IsPostBack)
- //{
- birthdayControl();
- //}
+
+ if (!IsPostBack || (Session["isCancle"] !=null && Session["isCancle"].Equals(true)))
+ {
+ birthdayControl();
+ Session["isCancle"] = null;
+ }
}
private void birthdayControl()
{
@@ -158,4 +160,9 @@ protected void healthButton_Click(object sender, EventArgs e)
healthTextBox.Text += healthDropDownList.SelectedValue;
}
}
+
+ protected void Button2_Click(object sender, EventArgs e)
+ {
+ Server.Transfer("customerCreate.aspx");
+ }
}

0 comments on commit 6636cd3

Please sign in to comment.