Posted on: 6/17/2013 9:03:18 AM | Views : 465

.aspx
<form id="form1" runat="server"> <br /> <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" /> <asp:Button ID="Button2" runat="server" OnClick="Button2_Click" Text="Button" /> </form> .cs
protected void Page_Load(object sender, EventArgs e) { function(); //need to run at !postback, postback and button2_click } protected void Button1_Click(object sender, EventArgs e) { Response.Write("1"); function(); } protected void Button2_Click(object sender, EventArgs e) { Response.Write("1"); function(); } public void function() { Response.Write("2"); } i simplied my program to the code as above.
My expected result: 1. Page load, display 2. 2. Click button1,  display 1,2. ...

Go to the complete details ...